Commit 4107f0fa authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens

Add define for symkey() to quiet the compiler.

2007-02-17  Kevin Cozens  <kcozens@cvs.gnome.org>

	* plug-ins/script-fu/tinyscheme/scheme-private.h: Add define for
	symkey() to quiet the compiler.

	* plug-ins/script-fu/tinyscheme/scheme.c (basic_inchar): Return
	blank when invalid UTF-8 character is encountered while reading
	from memory. Point to start of next valid character on error.

svn path=/trunk/; revision=21934
parent d212161c
2007-02-17 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/tinyscheme/scheme-private.h: Add define for
symkey() to quiet the compiler.
* plug-ins/script-fu/tinyscheme/scheme.c (basic_inchar): Return
blank when invalid UTF-8 character is encountered while reading
from memory. Point to start of next valid character on error.
2007-02-17 Michael Natterer <mitch@gimp.org>
* app/core/gimp-utils.[ch]
......@@ -172,6 +172,7 @@ pointer set_cdr(pointer p, pointer q);
int is_symbol(pointer p);
char *symname(pointer p);
char *symkey(pointer p);
int hasprop(pointer p);
int is_syntax(pointer p);
......
......@@ -1467,6 +1467,7 @@ static gunichar basic_inchar(port *pt) {
s = &utf8[1];
for (i = 0; i < len; ++i)
*s++ = fgetc(pt->rep.stdio.file);
/* FIXME: Check for bad character and search for next good char. */
return g_utf8_get_char_validated(utf8, len+1);
}
return (gunichar)utf8[0];
......@@ -1479,8 +1480,21 @@ static gunichar basic_inchar(port *pt) {
len = pt->rep.string.past_the_end - pt->rep.string.curr;
c = g_utf8_get_char_validated(pt->rep.string.curr, len);
len = g_unichar_to_utf8(c, NULL);
pt->rep.string.curr += len;
if (c < 0)
{
pt->rep.string.curr = g_utf8_find_next_char(pt->rep.string.curr,
pt->rep.string.past_the_end);
if (pt->rep.string.curr == NULL)
pt->rep.string.curr = pt->rep.string.past_the_end;
c = ' ';
}
else
{
len = g_unichar_to_utf8(c, NULL);
pt->rep.string.curr += len;
}
return c;
}
}
......
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