[dovecot-cvs] dovecot/src/lib seq-range-array.c,1.2,1.3

cras at dovecot.org cras at dovecot.org
Sat Apr 1 00:19:07 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv7301

Modified Files:
	seq-range-array.c 
Log Message:
Removal didn't work properly from beginning/end if the range contained only
a single sequence.



Index: seq-range-array.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/seq-range-array.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- seq-range-array.c	13 Jan 2006 20:26:01 -0000	1.2
+++ seq-range-array.c	31 Mar 2006 21:19:05 -0000	1.3
@@ -121,12 +121,18 @@
 	}
 	if (data[count-1].seq2 == seq) {
 		/* shrink last range */
-		data[count-1].seq2--;
+		if (data[count-1].seq1 != data[count-1].seq2)
+			data[count-1].seq2--;
+		else
+			array_delete(array, count-1, 1);
 		return;
 	}
 	if (data[0].seq1 == seq) {
 		/* shrink up first range */
-		data[0].seq1++;
+		if (data[0].seq1 != data[0].seq2)
+			data[0].seq1++;
+		else
+			array_delete(array, 0, 1);
 		return;
 	}
 



More information about the dovecot-cvs mailing list