Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7954:d75fdd0fb8b2 HEAD
Sort index sometimes failed wrongly with "Sort IDs broken" errors.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 26 Jun 2008 21:35:06 +0300 |
parents | 01c23befce4f |
children | 83019368c9dc |
files | src/lib-storage/index/index-sort-string.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-sort-string.c Thu Jun 26 21:33:36 2008 +0300 +++ b/src/lib-storage/index/index-sort-string.c Thu Jun 26 21:35:06 2008 +0300 @@ -613,7 +613,9 @@ } nodes[i].sort_id_changed = TRUE; } - return right_str == NULL || strcmp(str, right_str) < 0 ? 0 : -1; + return right_str == NULL || strcmp(str, right_str) < 0 || + (strcmp(str, right_str) == 0 && + nodes[i-1].sort_id == right_sort_id) ? 0 : -1; } static int