From ee48d4232053aee30adb5afb48b147e31d7aedfa Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 16 Aug 2007 09:18:11 +0200 Subject: [PATCH] Also support missing seconds. Signed-off-by: Pierre Habouzit --- lib-mime/rfc822parse.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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); } -- 2.20.1