aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-trie.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-21 03:06:49 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-21 03:06:49 +0800
commit8d9be87caabc2548b11548eeb4697683394301a7 (patch)
tree5caff1dc1e9eb925a052851d428e619c2e011f13 /e-util/e-trie.c
parentd7f89b244f8df95dc3f5ca6fbfc39f99db9a2659 (diff)
downloadgsoc2013-evolution-8d9be87caabc2548b11548eeb4697683394301a7.tar.gz
gsoc2013-evolution-8d9be87caabc2548b11548eeb4697683394301a7.tar.zst
gsoc2013-evolution-8d9be87caabc2548b11548eeb4697683394301a7.zip
If the gunichar is 0xfffe, just skip processing it. Maybe this will fix
2003-03-20 Jeffrey Stedfast <fejj@ximian.com> * e-trie.c (e_trie_search): If the gunichar is 0xfffe, just skip processing it. Maybe this will fix bug #39900. svn path=/trunk/; revision=20436
Diffstat (limited to 'e-util/e-trie.c')
-rw-r--r--e-util/e-trie.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/e-util/e-trie.c b/e-util/e-trie.c
index c0e4f49487..8a9600e6db 100644
--- a/e-util/e-trie.c
+++ b/e-util/e-trie.c
@@ -314,26 +314,28 @@ e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id)
while ((c = trie_utf8_getc (&inptr, inlen))) {
inlen = (inend - inptr);
- if (trie->icase)
- c = g_unichar_tolower (c);
-
- while (q != NULL && (m = g (q, c)) == NULL)
- q = q->fail;
-
- if (q == &trie->root)
- pat = prev;
-
- if (q == NULL) {
- q = &trie->root;
- pat = inptr;
- } else if (m != NULL) {
- q = m->state;
+ if (c != 0xfffe) {
+ if (trie->icase)
+ c = g_unichar_tolower (c);
+
+ while (q != NULL && (m = g (q, c)) == NULL)
+ q = q->fail;
- if (q->final) {
- if (matched_id)
- *matched_id = q->id;
+ if (q == &trie->root)
+ pat = prev;
+
+ if (q == NULL) {
+ q = &trie->root;
+ pat = inptr;
+ } else if (m != NULL) {
+ q = m->state;
- return (const char *) pat;
+ if (q->final) {
+ if (matched_id)
+ *matched_id = q->id;
+
+ return (const char *) pat;
+ }
}
}