[dovecot-cvs] dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.15, 1.16

cras at dovecot.org cras at dovecot.org
Mon Jul 26 17:49:04 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv15785/lib-storage/index/mbox

Modified Files:
	istream-raw-mbox.c 
Log Message:
mbox parsing fix



Index: istream-raw-mbox.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- istream-raw-mbox.c	2 Jul 2004 13:34:37 -0000	1.15
+++ istream-raw-mbox.c	26 Jul 2004 14:49:01 -0000	1.16
@@ -200,7 +200,7 @@
 
 	/* See if we have From-line here - note that it works right only
 	   because all characters are different in mbox_from. */
-        fromp = mbox_from; from_start_pos = 0;
+        fromp = mbox_from; from_start_pos = (size_t)-1;
 	eoh_char = rstream->body_offset == (uoff_t)-1 ? '\n' : '\0';
 	for (i = stream->pos; i < pos; i++) {
 		if (buf[i] == eoh_char &&
@@ -218,7 +218,7 @@
 				i++;
 				from_start_pos = i - 6;
 				fromp = mbox_from;
-			} else if (from_start_pos != 0) {
+			} else if (from_start_pos != (size_t)-1) {
 				/* we have the whole From-line here now.
 				   See if it's a valid one. */
 				if (mbox_from_parse(buf + from_start_pos + 6,
@@ -236,7 +236,7 @@
 							   from_start_pos);
 					break;
 				}
-				from_start_pos = 0;
+				from_start_pos = (size_t)-1;
 			}
 		} else {
 			fromp = mbox_from;
@@ -248,7 +248,7 @@
 	/* we want to go at least one byte further next time */
 	rstream->input_peak_offset = stream->istream.v_offset + i;
 
-	if (from_start_pos != 0) {
+	if (from_start_pos != (size_t)-1) {
 		/* we're waiting for the \n at the end of From-line */
 		new_pos = from_start_pos;
 	} else {



More information about the dovecot-cvs mailing list