projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0571c4
)
Also support missing seconds.
author
Pierre Habouzit
<madcoder@debian.org>
Thu, 16 Aug 2007 07:18:11 +0000
(09:18 +0200)
committer
Pierre Habouzit
<madcoder@debian.org>
Thu, 16 Aug 2007 07:18:11 +0000
(09:18 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-mime/rfc822parse.c
patch
|
blob
|
history
diff --git
a/lib-mime/rfc822parse.c
b/lib-mime/rfc822parse.c
index
d2fb218
..
d5614fc
100644
(file)
--- 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);
}