Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7613:63602977ca9b HEAD
sort index: Messages without sort_id weren't sorted correctly on secondary
sort conditions.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 06 Jun 2008 20:07:45 +0300 |
parents | 5824e6f1d279 |
children | dd899a1841d9 |
files | src/lib-storage/index/index-sort-string.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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; + int ret; - return strcmp(static_zero_cmp_context->sort_strings[n1->seq], - static_zero_cmp_context->sort_strings[n2->seq]); + 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)