dovecot-1.1: sort index: Messages without sort_id weren't sorted...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jun 6 20:08:27 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/63602977ca9b
changeset: 7613:63602977ca9b
user: Timo Sirainen <tss at iki.fi>
date: Fri Jun 06 20:07:45 2008 +0300
description:
sort index: Messages without sort_id weren't sorted correctly on secondary
sort conditions.
diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
src/lib-storage/index/index-sort-string.c | 13 ++++++++++---
diffs (24 lines):
diff -r 5824e6f1d279 -r 63602977ca9b src/lib-storage/index/index-sort-string.c
--- a/src/lib-storage/index/index-sort-string.c Fri Jun 06 19:40:07 2008 +0300
+++ b/src/lib-storage/index/index-sort-string.c Fri Jun 06 20:07:45 2008 +0300
@@ -213,10 +213,17 @@ void index_sort_list_add_string(struct m
static int sort_node_zero_string_cmp(const void *p1, const void *p2)
{
+ struct sort_string_context *ctx = static_zero_cmp_context;
const struct mail_sort_node *n1 = p1, *n2 = p2;
-
- return strcmp(static_zero_cmp_context->sort_strings[n1->seq],
- static_zero_cmp_context->sort_strings[n2->seq]);
+ int ret;
+
+ ret = strcmp(ctx->sort_strings[n1->seq], ctx->sort_strings[n2->seq]);
+ if (ret != 0)
+ return ret;
+
+ return index_sort_node_cmp_type(ctx->program->temp_mail,
+ ctx->program->sort_program + 1,
+ n1->seq, n2->seq);
}
static void index_sort_zeroes(struct sort_string_context *ctx)
More information about the dovecot-cvs
mailing list