[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-from.c, 1.5, 1.6

cras at dovecot.org cras at dovecot.org
Fri Aug 19 18:49:51 EEST 2005


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

Modified Files:
	mbox-from.c 
Log Message:
Allow day field to contain only a single digit without preceding zero/space.



Index: mbox-from.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-from.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mbox-from.c	21 Dec 2004 12:40:46 -0000	1.5
+++ mbox-from.c	19 Aug 2005 15:49:49 -0000	1.6
@@ -86,19 +86,22 @@
 		return -1;
 	msg += 4;
 
-	/* day */
-	if (msg[0] == ' ') {
-		if (!i_isdigit(msg[1]) || msg[2] != ' ')
+	/* day. single digit is usually preceded by extra space */
+	if (msg[0] == ' ')
+		msg++;
+	if (msg[1] == ' ') {
+		if (!i_isdigit(msg[0]))
 			return -1;
-		tm.tm_mday = msg[1]-'0';
+		tm.tm_mday = msg[0]-'0';
+		msg += 2;
 	} else {
 		if (!i_isdigit(msg[0]) || !i_isdigit(msg[1]) || msg[2] != ' ')
 			return -1;
 		tm.tm_mday = (msg[0]-'0') * 10 + (msg[1]-'0');
+		msg += 3;
 	}
 	if (tm.tm_mday == 0)
 		tm.tm_mday = 1;
-	msg += 3;
 
 	/* hour */
 	if (!i_isdigit(msg[0]) || !i_isdigit(msg[1]) || msg[2] != ':')



More information about the dovecot-cvs mailing list