diff options
-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); } } |