aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-text-index.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-10-28 04:21:19 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-10-28 04:21:19 +0800
commit779d9a48b878fc6ab885247ba6843243e8183f57 (patch)
tree0fb458287d50a1e0c93fb03cce8abd18cf781d0e /camel/camel-text-index.c
parent81a6d7f5fe9db8975d67e3fe6dae440ecd8f948c (diff)
downloadgsoc2013-evolution-779d9a48b878fc6ab885247ba6843243e8183f57.tar.gz
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/camel-text-index.c')
-rw-r--r--camel/camel-text-index.c7
1 files changed, 5 insertions, 2 deletions
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);
}
}