[dovecot-cvs] dovecot/src/lib-index/mbox mbox-from.c,1.10,1.11

cras at procontrol.fi cras at procontrol.fi
Fri Feb 21 20:10:57 EET 2003


Update of /home/cvs/dovecot/src/lib-index/mbox
In directory danu:/tmp/cvs-serv22426

Modified Files:
	mbox-from.c 
Log Message:
Support parsing some broken mbox From-lines



Index: mbox-from.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/mbox-from.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mbox-from.c	5 Jan 2003 13:09:52 -0000	1.10
+++ mbox-from.c	21 Feb 2003 18:10:54 -0000	1.11
@@ -47,6 +47,11 @@
 		}
 	}
 
+	if (i == 12 && memcmp(msg, "???", 3) == 0) {
+		/* just a hack to parse one special mbox I have :) */
+		i = 0;
+	}
+
 	if (i == 12 || msg[3] != ' ')
 		return (time_t)-1;
 	msg += 4;
@@ -61,6 +66,8 @@
 			return (time_t)-1;
 		tm.tm_mday = (msg[0]-'0') * 10 + (msg[1]-'0');
 	}
+	if (tm.tm_mday == 0)
+		tm.tm_mday = 1;
 	msg += 3;
 
 	/* hour */




More information about the dovecot-cvs mailing list