changeset 8479:bcdbf33ae9b8 HEAD

Fix to previous search_next_update_seq change.
author Timo Sirainen <tss@iki.fi>
date Sun, 23 Nov 2008 01:59:35 +0200
parents adf36d9cd338
children f0c9677bf489
files src/lib-storage/index/index-search.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c	Sun Nov 23 01:47:30 2008 +0200
+++ b/src/lib-storage/index/index-search.c	Sun Nov 23 01:59:35 2008 +0200
@@ -1164,7 +1164,7 @@
         struct index_search_context *ctx = (struct index_search_context *)_ctx;
 	struct mailbox *box = _ctx->transaction->box;
 	unsigned int count = 0;
-	bool match, never;
+	bool match = FALSE, never;
 
 	*tryagain_r = FALSE;
 
@@ -1236,7 +1236,7 @@
 	ctx->mail = NULL;
 	ctx->imail = NULL;
 
-	if (_ctx->sort_program != NULL && !ctx->failed) {
+	if (!match && _ctx->sort_program != NULL && !ctx->failed) {
 		/* finished searching the messages. now sort them and start
 		   returning the messages. */
 		ctx->sorted = TRUE;
@@ -1245,7 +1245,7 @@
 							  tryagain_r);
 	}
 
-	return ctx->failed ? -1 : 0;
+	return ctx->failed ? -1 : (match ? 1 : 0);
 }
 
 bool index_storage_search_next_update_seq(struct mail_search_context *_ctx)