RSSyl: Day-of-week name in RFC822 timestamps is optional.
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 8 Jan 2015 21:51:04 +0000 (22:51 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 8 Jan 2015 21:51:04 +0000 (22:51 +0100)
src/plugins/rssyl/libfeed/date.c

index c37756d44f72adef6b79922d49c2b192141671fa..92f5a860dae3132ff8476eabf19f7dc58f9052d9 100644 (file)
@@ -132,8 +132,11 @@ time_t parseRFC822Date(gchar *date)
        if (c != NULL)
                setlocale(LC_TIME, "C");
 
-       if (!strptime(date, "%a, %d %b %Y %H:%M:%S %Z", &t) &&
-               !strptime(date, "%a, %d %b %Y %H:%M %Z", &t)) {
+       if (date != NULL &&
+                       !strptime(date, "%a, %d %b %Y %H:%M:%S %Z", &t) &&
+                       !strptime(date, "%a, %d %b %Y %H:%M %Z", &t) &&
+                       !strptime(date, "%d %b %Y %H:%M:%S %Z", &t) &&
+                       !strptime(date, "%d %b %Y %H:%M %Z", &t)) {
                g_warning("Invalid RFC822 date!\n");
                if (c != NULL)
                        setlocale(LC_TIME, c);