From 39bc77da508f61f1c2c89db68eb6a4b12c1fad00 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 11 Feb 2003 10:51:41 +0000 Subject: Instead of simply ignoring bad chars, return the sentinal invalid char 2003-02-11 Not Zed * 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 --- e-util/e-trie.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'e-util/e-trie.c') 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; -- cgit v1.2.3