[dovecot-cvs] dovecot/src/lib-storage/index index-search.c, 1.112.2.3, 1.112.2.4

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


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

Modified Files:
      Tag: branch_1_0
	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.112.2.3
retrieving revision 1.112.2.4
diff -u -d -r1.112.2.3 -r1.112.2.4
--- index-search.c	24 Jun 2006 21:29:02 -0000	1.112.2.3
+++ index-search.c	26 Jun 2006 08:35:48 -0000	1.112.2.4
@@ -613,6 +613,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 &&
@@ -639,8 +642,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