From 655c9cbf97de5f304784fdf2f1fcb9e258f526ca Mon Sep 17 00:00:00 2001 From: Suresh Chandrasekharan Date: Thu, 14 Aug 2003 16:56:34 +0000 Subject: Fix for 45818 ( i18n mail messages search only produces '[?]'). Now 2003-08-13 Suresh Chandrasekharan * e-searching-tokenizer.c (searcher_next_token): Fix for 45818 ( i18n mail messages search only produces '[?]'). Now multibyte character selection works correctly. But due to associated gtkhtml bug, the find button functionallity for multibyte characters is broken. svn path=/trunk/; revision=22236 --- mail/ChangeLog | 7 +++++++ mail/e-searching-tokenizer.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index b74f1dcdf6..5fbc2b873d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2003-08-13 Suresh Chandrasekharan + + * e-searching-tokenizer.c (searcher_next_token): Fix for 45818 ( i18n + mail messages search only produces '[?]'). Now multibyte character + selection works correctly. But due to associated gtkhtml bug, the find + button functionallity for multibyte characters is broken. + 2003-08-12 Jeffrey Stedfast * mail-tools.h: Removed unused function prototype. diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c index 01e055ff84..44e88df378 100644 --- a/mail/e-searching-tokenizer.c +++ b/mail/e-searching-tokenizer.c @@ -717,7 +717,7 @@ static char * searcher_next_token(struct _searcher *s) { struct _token *token; - char *tok, *stok; + char *tok, *stok, *pre_tok; struct _trie *t = s->t; struct _state *q = s->state; struct _match *m = NULL; @@ -753,7 +753,7 @@ searcher_next_token(struct _searcher *s) } /* process whole token */ - stok = tok; + pre_tok = stok = tok; while ((c = camel_utf8_getc((const unsigned char **)&tok))) { if ((s->flags & SEARCH_CASE) == 0) c = g_unichar_tolower(c); @@ -765,7 +765,7 @@ searcher_next_token(struct _searcher *s) q = &t->root; } else if (m != NULL) { /* keep track of previous offsets of utf8 chars, rotating buffer */ - s->last[s->lastp] = s->offset + (tok-stok)-1; + s->last[s->lastp] = s->offset + (pre_tok-stok); s->lastp = (s->lastp+1)&s->last_mask; q = m->match; @@ -798,9 +798,10 @@ searcher_next_token(struct _searcher *s) } } } + pre_tok = tok; } - s->offset += (tok-stok)-1; + s->offset += (pre_tok-stok); flush_extra(s); } -- cgit v1.2.3