Commit 182b2e27 authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens
Browse files

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
parent d3209752
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;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment