diff options
author | Not Zed <NotZed@Ximian.com> | 2003-02-11 18:51:41 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-02-11 18:51:41 +0800 |
commit | 39bc77da508f61f1c2c89db68eb6a4b12c1fad00 (patch) | |
tree | 10afaa16145f476ce8210e69f95490864dc5c4c5 /e-util/e-trie.c | |
parent | 46e6fb3e66990e0eef417121df9bc2fc71d7f4ca (diff) | |
download | gsoc2013-evolution-39bc77da508f61f1c2c89db68eb6a4b12c1fad00.tar.gz gsoc2013-evolution-39bc77da508f61f1c2c89db68eb6a4b12c1fad00.tar.zst gsoc2013-evolution-39bc77da508f61f1c2c89db68eb6a4b12c1fad00.zip |
Instead of simply ignoring bad chars, return the sentinal invalid char
2003-02-11 Not Zed <NotZed@Ximian.com>
* e-trie.c (trie_utf8_getc): Instead of simply ignoring bad chars,
return the sentinal invalid char 0xfffe, so that we properly track
the start of sequences.
svn path=/trunk/; revision=19881
Diffstat (limited to 'e-util/e-trie.c')
-rw-r--r-- | e-util/e-trie.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/e-util/e-trie.c b/e-util/e-trie.c index da1a162115..307cb3ec95 100644 --- a/e-util/e-trie.c +++ b/e-util/e-trie.c @@ -82,10 +82,8 @@ loop: return 0; c = *inptr++; - if ((c & 0xc0) != 0x80) { - r = c; - goto loop; - } + if ((c & 0xc0) != 0x80) + goto error; u = (u << 6) | (c & 0x3f); r <<= 1; @@ -96,7 +94,9 @@ loop: u &= ~m; } else { - goto again; + error: + *in = (*in)+1; + u = 0xfffe; } return u; |