From: Pierre Habouzit Date: Thu, 16 Aug 2007 07:18:11 +0000 (+0200) Subject: Also support missing seconds. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=ee48d4232053aee30adb5afb48b147e31d7aedfa Also support missing seconds. Signed-off-by: Pierre Habouzit --- diff --git a/lib-mime/rfc822parse.c b/lib-mime/rfc822parse.c index d2fb218..d5614fc 100644 --- a/lib-mime/rfc822parse.c +++ b/lib-mime/rfc822parse.c @@ -592,9 +592,18 @@ time_t mutt_parse_date(const char *s, HEADER *h) { struct tm tm; const char *loc; - p_clear(&tm, 1); loc = setlocale(LC_TIME, "C"); - s = strptime(s, "%a, %d %b %Y %T %z", &tm); + + p_clear(&tm, 1); + if (strptime(s, "%a, %d %b %Y %H:%M:%S %z", &tm)) + goto ok; + p_clear(&tm, 1); + if (strptime(s, "%a, %d %b %Y %H:%M %z", &tm)) + goto ok; + setlocale(LC_TIME, loc); + return 0; + + ok: setlocale(LC_TIME, loc); return mutt_mktime(&tm, 1); }