mirror of https://github.com/GNOME/gimp.git
Use the string length in bytes passed in instead of recalculating it.
2007-08-13 Kevin Cozens <kcozens@cvs.gnome.org> * plug-ins/script-fu/scheme-wrapper.c (ts_output_string): Use the string length in bytes passed in instead of recalculating it. * plug-ins/script-fu/tinyscheme/scheme.c: Added comment. svn path=/trunk/; revision=23239
This commit is contained in:
parent
47876907dd
commit
2dfb1e5193
|
@ -1,3 +1,10 @@
|
|||
2007-08-13 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/scheme-wrapper.c (ts_output_string): Use the
|
||||
string length in bytes passed in instead of recalculating it.
|
||||
|
||||
* plug-ins/script-fu/tinyscheme/scheme.c: Added comment.
|
||||
|
||||
2007-08-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/gimphistogram.c (gimp_histogram_get_std_dev): corrected
|
||||
|
|
|
@ -259,30 +259,25 @@ ts_get_error_msg (void)
|
|||
const gchar *
|
||||
ts_get_success_msg (void)
|
||||
{
|
||||
if (sc.vptr->is_string(sc.value)) {
|
||||
if (sc.vptr->is_string(sc.value))
|
||||
return sc.vptr->string_value(sc.value);
|
||||
}
|
||||
else
|
||||
return "Success";
|
||||
|
||||
return "Success";
|
||||
}
|
||||
|
||||
/* len is length of 'string' in bytes */
|
||||
void
|
||||
ts_output_string (const char *string, int len)
|
||||
{
|
||||
g_return_if_fail (len >= 0);
|
||||
|
||||
if (len > 0 && ts_console_mode)
|
||||
{
|
||||
/* len is the number of UTF-8 characters; we need the number of bytes */
|
||||
len = g_utf8_offset_to_pointer (string, len) - string;
|
||||
|
||||
script_fu_output_to_console (string, len);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void init_constants (void);
|
||||
static void init_procedures (void);
|
||||
static void init_constants (void);
|
||||
static void init_procedures (void);
|
||||
|
||||
static gboolean register_scripts = FALSE;
|
||||
|
||||
|
|
|
@ -1550,6 +1550,7 @@ static void putchars(scheme *sc, const char *chars, int char_cnt) {
|
|||
if (char_cnt <= 0)
|
||||
return;
|
||||
|
||||
/* Get length of 'chars' in bytes */
|
||||
char_cnt = g_utf8_offset_to_pointer(chars, (long)char_cnt) - chars;
|
||||
|
||||
if (sc->print_error) {
|
||||
|
|
Loading…
Reference in New Issue