aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorFrédéric Crozat <fcrozat@src.gnome.org>2003-10-28 21:22:13 +0800
committerFrédéric Crozat <fcrozat@src.gnome.org>2003-10-28 21:22:13 +0800
commit196efb7acc28bd33d576a84feebf0b5c608825cf (patch)
tree0bdb4e0e9fac649707c7b0b9203dedaefaacb9e1 /camel
parent9d85d642b2c21d8c0491fd0a9712aff76aa7dc08 (diff)
downloadgsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar.gz
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar.bz2
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar.lz
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar.xz
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.tar.zst
gsoc2013-evolution-196efb7acc28bd33d576a84feebf0b5c608825cf.zip
better detection of broken date to give to broken_date_parser.
* camel-mime-utils.c: (camel_header_decode_date): better detection of broken date to give to broken_date_parser. svn path=/trunk/; revision=23101
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-mime-utils.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5deff48ddb..da7ff58e28 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-27 Frederic Crozat <fcrozat@mandrakesoft.com>
+
+ * camel-mime-utils.c: (camel_header_decode_date):
+ better detection of broken date to give to broken_date_parser.
+
2003-10-24 Jeffrey Stedfast <fejj@ximian.com>
* camel-text-index.c (text_index_name_add_buffer): If a word is
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 3d4ec2f367..967762dc65 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -3489,6 +3489,7 @@ camel_header_decode_date(const char *in, int *saveoffset)
{
const char *inptr = in;
char *monthname;
+ gboolean foundmonth;
int year, offset = 0;
struct tm tm;
int i;
@@ -3526,16 +3527,30 @@ camel_header_decode_date(const char *in, int *saveoffset)
}
}
tm.tm_mday = camel_header_decode_int(&inptr);
+#ifndef CLEAN_DATE
+ if (tm.tm_mday == 0) {
+ return parse_broken_date (in, saveoffset);
+ }
+#endif /* ! CLEAN_DATE */
+
monthname = decode_token(&inptr);
+ foundmonth = FALSE;
if (monthname) {
for (i=0;i<sizeof(tz_months)/sizeof(tz_months[0]);i++) {
if (!strcasecmp(tz_months[i], monthname)) {
tm.tm_mon = i;
+ foundmonth = TRUE;
break;
}
}
g_free(monthname);
}
+#ifndef CLEAN_DATE
+ if (!foundmonth) {
+ return parse_broken_date (in, saveoffset);
+ }
+#endif /* ! CLEAN_DATE */
+
year = camel_header_decode_int(&inptr);
if (year < 69) {
tm.tm_year = 100 + year;