dovecot-1.1: Fixes to sort indexing.

dovecot at dovecot.org dovecot at dovecot.org
Thu May 29 07:05:39 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/8ae86f73f80d
changeset: 7566:8ae86f73f80d
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 29 07:05:18 2008 +0300
description:
Fixes to sort indexing.

diffstat:

1 file changed, 9 insertions(+), 3 deletions(-)
src/lib-storage/index/index-sort-string.c |   12 +++++++++---

diffs (29 lines):

diff -r 6930859e7a5a -r 8ae86f73f80d src/lib-storage/index/index-sort-string.c
--- a/src/lib-storage/index/index-sort-string.c	Thu May 29 06:17:24 2008 +0300
+++ b/src/lib-storage/index/index-sort-string.c	Thu May 29 07:05:18 2008 +0300
@@ -366,8 +366,14 @@ index_sort_bsearch(struct sort_string_co
 
 	*idx_r = idx;
 	if (idx > start_idx) {
-		*prev_str_r = index_sort_get_string(ctx, idx - 1,
-						    nodes[idx-1].seq);
+		prev = idx;
+		do {
+			prev--;
+			str2 = index_sort_get_string(ctx, prev,
+						     nodes[prev].seq);
+		} while (str2 == &expunged_msg && prev > 0 &&
+			 nodes[prev-1].sort_id == nodes[prev].sort_id);
+		*prev_str_r = str2;
 	}
 }
 
@@ -408,7 +414,7 @@ static void index_sort_merge(struct sort
 
 		if (ret <= 0) {
 			array_append(&ctx->sorted_nodes, &znodes[zpos], 1);
-			prev_str = nzstr;
+			prev_str = zstr;
 			zpos++;
 		} else {
 			array_append(&ctx->sorted_nodes, &nznodes[nzpos], 1);


More information about the dovecot-cvs mailing list