qulogic/libgnt

c311e3873c3b
Parents 19863987001c
Children 4b4d7e1c9940
Fixes a crash when next_begin_word is called on trailing spaces at the
end of an entry.

applied changes from 0b25c9dd3deaa5c16f7deff33c36af4812f2629a
through abef8860abbb7cbebfd89a34d86d43457c0b5caf
  • +7 -5
    gntentry.c
  • --- a/gntentry.c Tue May 27 04:10:43 2008 +0000
    +++ b/gntentry.c Fri Jun 06 03:04:05 2008 +0000
    @@ -580,11 +580,13 @@
    while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
    text = g_utf8_find_next_char(text, end);
    - ch = g_utf8_get_char(text);
    - while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
    - gunichar cur = g_utf8_get_char(text);
    - if (!SAME(ch, cur))
    - break;
    + if (text) {
    + ch = g_utf8_get_char(text);
    + while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
    + gunichar cur = g_utf8_get_char(text);
    + if (!SAME(ch, cur))
    + break;
    + }
    }
    return (text ? text : end);
    }