dovecot-1.1: Fixed squat lookup.
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 16 13:22:00 EET 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/eb310b0d0966
changeset: 7249:eb310b0d0966
user: Timo Sirainen <tss at iki.fi>
date: Sat Feb 16 13:22:11 2008 +0200
description:
Fixed squat lookup.
diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
src/plugins/fts-squat/squat-trie.c | 12 ++++++------
diffs (30 lines):
diff -r 139f2f03b81b -r eb310b0d0966 src/plugins/fts-squat/squat-trie.c
--- a/src/plugins/fts-squat/squat-trie.c Sat Feb 16 13:21:35 2008 +0200
+++ b/src/plugins/fts-squat/squat-trie.c Sat Feb 16 13:22:11 2008 +0200
@@ -1800,10 +1800,10 @@ squat_trie_lookup_partial(struct squat_t
int ret;
max_chars = uni_utf8_strlen_n(data, size);
- if (max_chars > ctx->trie->hdr.partial_len)
- max_chars = partial_len;
-
- for (i = 0, char_idx = 0; char_idx < max_chars; char_idx++) {
+ i_assert(max_chars > 0);
+
+ i = 0; char_idx = 0;
+ do {
bytelen = 0;
for (j = 0; j < partial_len && i+bytelen < size; j++)
bytelen += char_lengths[i + bytelen];
@@ -1825,9 +1825,9 @@ squat_trie_lookup_partial(struct squat_t
seq_range_array_remove_invert_range(ctx->maybe_uids,
&ctx->tmp_uids2);
}
-
i += char_lengths[i];
- }
+ char_idx++;
+ } while (max_chars - char_idx >= partial_len);
return 1;
}
More information about the dovecot-cvs
mailing list