mirror of https://github.com/GNOME/gimp.git
Update "cursor" after writing characters to a string buffer. Fixes bug
2007-06-13 Kevin Cozens <kcozens@cvs.gnome.org> * plug-ins/script-fu/tinyscheme/scheme.c (putchars): Update "cursor" after writing characters to a string buffer. Fixes bug #446884. svn path=/trunk/; revision=22774
This commit is contained in:
parent
d32097528e
commit
182b2e27f8
|
@ -1,3 +1,8 @@
|
|||
2007-06-13 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/tinyscheme/scheme.c (putchars): Update "cursor"
|
||||
after writing characters to a string buffer. Fixes bug #446884.
|
||||
|
||||
2007-06-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/app.c (app_exit_after_callback): if GIMP_UNSTABLE is
|
||||
|
|
|
@ -1553,6 +1553,7 @@ static void backchar(scheme *sc, gunichar c) {
|
|||
|
||||
/* len is number of UTF-8 characters in string pointed to by chars */
|
||||
static void putchars(scheme *sc, const char *chars, int char_cnt) {
|
||||
int free_bytes; /* Space remaining in buffer (in bytes) */
|
||||
int l;
|
||||
char *s;
|
||||
port *pt=sc->outport->_object._port;
|
||||
|
@ -1584,9 +1585,13 @@ static void putchars(scheme *sc, const char *chars, int char_cnt) {
|
|||
}
|
||||
#endif
|
||||
} else {
|
||||
l = pt->rep.string.past_the_end - pt->rep.string.curr;
|
||||
if (l > 0)
|
||||
memcpy(pt->rep.string.curr, chars, min(char_cnt, l));
|
||||
free_bytes = pt->rep.string.past_the_end - pt->rep.string.curr;
|
||||
if (free_bytes > 0)
|
||||
{
|
||||
l = min(char_cnt, free_bytes);
|
||||
memcpy(pt->rep.string.curr, chars, l);
|
||||
pt->rep.string.curr += l;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue