aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-02-15 05:11:00 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-02-15 05:11:00 +0000
commit58c6dc0f1481791c028fc61975f3d917c3053d45 (patch)
treec525ca25e682c95ccb9101bdcae32d22d8748b9e /libsylph
parented78676f7cf441e0ac3395a073729c720b5b772e (diff)
Supported more non-standard date.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3229 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procheader.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/libsylph/procheader.c b/libsylph/procheader.c
index bd635363..ec8667b4 100644
--- a/libsylph/procheader.c
+++ b/libsylph/procheader.c
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2013 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -817,6 +817,14 @@ static gint procheader_scan_date_string(const gchar *str,
weekday, day, month, year, hh, mm, ss, zone);
if (result == 8) return 0;
+ result = sscanf(str, "%3s,%d %9s %d %2d.%2d.%2d %5s",
+ weekday, day, month, year, hh, mm, ss, zone);
+ if (result == 8) return 0;
+
+ result = sscanf(str, "%3s %d, %9s %d %2d:%2d:%2d %5s",
+ weekday, day, month, year, hh, mm, ss, zone);
+ if (result == 8) return 0;
+
result = sscanf(str, "%d %9s %d %2d:%2d:%2d %5s",
day, month, year, hh, mm, ss, zone);
if (result == 7) return 0;
@@ -830,6 +838,10 @@ static gint procheader_scan_date_string(const gchar *str,
day, month, year, hh, mm, ss);
if (result == 6) return 0;
+ result = sscanf(str, "%d-%2s-%2d %2d:%2d:%2d",
+ year, month, day, hh, mm, ss);
+ if (result == 6) return 0;
+
*ss = 0;
result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s",
weekday, day, month, year, hh, mm, zone);
@@ -839,11 +851,6 @@ static gint procheader_scan_date_string(const gchar *str,
day, month, year, hh, mm, zone);
if (result == 6) return 0;
- *zone = '\0';
- result = sscanf(str, "%d-%2s-%2d %2d:%2d:%2d",
- year, month, day, hh, mm, ss);
- if (result == 6) return 0;
-
result = sscanf(str, "%10s %d %9s %d %2d:%2d",
weekday, day, month, year, hh, mm);
if (result == 6) return 0;
@@ -872,6 +879,7 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
if (procheader_scan_date_string(src, weekday, &day, month, &year,
&hh, &mm, &ss, zone) < 0) {
+ g_warning("procheader_scan_date_string: date parse failed: %s", src);
if (dest && len > 0)
strncpy2(dest, src, len);
return 0;