[dovecot-cvs] dovecot/src/lib-storage/index index-search.c, 1.117, 1.118

cras at dovecot.org cras at dovecot.org
Mon Jun 26 11:35:52 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv28500

Modified Files:
	index-search.c 
Log Message:
Searching (storing, fetching) with sequence sets containing commas was
broken



Index: index-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- index-search.c	24 Jun 2006 21:29:03 -0000	1.117
+++ index-search.c	26 Jun 2006 08:35:50 -0000	1.118
@@ -614,6 +614,9 @@
 			     struct mail_search_seqset *set,
 			     uint32_t *seq1_r, uint32_t *seq2_r, bool not)
 {
+	struct mail_search_seqset full_set;
+	uint32_t min_seq = (uint32_t)-1, max_seq = 0;
+
 	for (; set != NULL; set = set->next) {
 		if (set->seq1 > hdr->messages_count) {
 			if (set->seq1 != (uint32_t)-1 &&
@@ -640,8 +643,16 @@
 			return -1;
 		}
 
-		update_seqs(set, hdr, seq1_r, seq2_r, not);
+		if (set->seq1 < min_seq)
+			min_seq = set->seq1;
+		if (set->seq2 > max_seq)
+			max_seq = set->seq2;
 	}
+
+	full_set.seq1 = min_seq;
+	full_set.seq2 = max_seq;
+	full_set.next = NULL;
+	update_seqs(&full_set, hdr, seq1_r, seq2_r, not);
 	return 0;
 }
 



More information about the dovecot-cvs mailing list