diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-10-28 04:21:19 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-10-28 04:21:19 +0800 |
commit | 779d9a48b878fc6ab885247ba6843243e8183f57 (patch) | |
tree | 0fb458287d50a1e0c93fb03cce8abd18cf781d0e /camel | |
parent | 81a6d7f5fe9db8975d67e3fe6dae440ecd8f948c (diff) | |
download | gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.gz gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.bz2 gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.lz gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.xz gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.zst gsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.zip |
If a word is longer than CAMEL_TEXT_INDEX_MAX_WORDLEN, then ignore it.
2003-10-24 Jeffrey Stedfast <fejj@ximian.com>
* camel-text-index.c (text_index_name_add_buffer): If a word is
longer than CAMEL_TEXT_INDEX_MAX_WORDLEN, then ignore it. This
fixes bug #50096.
svn path=/trunk/; revision=23091
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-text-index.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 66263461df..5deff48ddb 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2003-10-24 Jeffrey Stedfast <fejj@ximian.com> + + * camel-text-index.c (text_index_name_add_buffer): If a word is + longer than CAMEL_TEXT_INDEX_MAX_WORDLEN, then ignore it. This + fixes bug #50096. + 2003-10-23 Jeffrey Stedfast <fejj@ximian.com> * *.c: Removed unneeded CAMEL_OBJECT() casts. diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c index fd10a5ce5f..0e8b1ca96f 100644 --- a/camel/camel-text-index.c +++ b/camel/camel-text-index.c @@ -53,6 +53,8 @@ /* cursor debug */ #define c(x) +#define CAMEL_TEXT_INDEX_MAX_WORDLEN (36) + #define CAMEL_TEXT_INDEX_LOCK(kf, lock) (e_mutex_lock(((CamelTextIndex *)kf)->priv->lock)) #define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) (e_mutex_unlock(((CamelTextIndex *)kf)->priv->lock)) @@ -1465,11 +1467,12 @@ text_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len) utf8[utf8len] = 0; g_string_append(p->buffer, utf8); } else { - if (p->buffer->len) { + if (p->buffer->len > 0 && p->buffer->len <= CAMEL_TEXT_INDEX_MAX_WORDLEN) { text_index_name_add_word(idn, p->buffer->str); /*camel_index_name_add_word(idn, p->buffer->str);*/ - g_string_truncate(p->buffer, 0); } + + g_string_truncate (p->buffer, 0); } } |