diff options
author | Michael Elkins <me@sigpipe.org> | 2010-08-05 21:57:07 -0700 |
---|---|---|
committer | Michael Elkins <me@sigpipe.org> | 2010-08-05 21:57:07 -0700 |
commit | c1cf4714d516751bf2518402b147013b7e0e103f (patch) | |
tree | 15cae197c788484bd71def659cf143a2b5a5163d | |
parent | 51423c19f4c6f5a7a8a43f3329c25450682386ab (diff) |
when parsing From_ lines in mmdf/mbox, the TZ should be computed based on the time in the string rather than the current time, otherwise DST issues cause the computed time to be wrong.
closes #2177
-rw-r--r-- | mbox.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -85,7 +85,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx) char return_path[LONG_STRING]; int count = 0, oldmsgcount = ctx->msgcount; int lines; - time_t t, tz; + time_t t; LOFF_T loc, tmploc; HEADER *hdr; struct stat sb; @@ -112,10 +112,6 @@ int mmdf_parse_mailbox (CONTEXT *ctx) } #endif - /* precompute the local timezone to speed up calculation of the - received time */ - tz = mutt_local_tz (0); - buf[sizeof (buf) - 1] = 0; if (!ctx->quiet) @@ -163,7 +159,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx) } } else - hdr->received = t - tz; + hdr->received = t - mutt_local_tz (t); hdr->env = mutt_read_rfc822_header (ctx->fp, hdr, 0, 0); @@ -237,7 +233,7 @@ int mbox_parse_mailbox (CONTEXT *ctx) struct stat sb; char buf[HUGE_STRING], return_path[STRING]; HEADER *curhdr; - time_t t, tz; + time_t t; int count = 0, lines = 0; LOFF_T loc; #ifdef NFS_ATTRIBUTE_HACK @@ -268,10 +264,6 @@ int mbox_parse_mailbox (CONTEXT *ctx) if (!ctx->readonly) ctx->readonly = access (ctx->path, W_OK) ? 1 : 0; - /* precompute the local timezone to speed up calculation of the - date received */ - tz = mutt_local_tz (0); - if (!ctx->quiet) { snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path); @@ -308,7 +300,7 @@ int mbox_parse_mailbox (CONTEXT *ctx) mx_alloc_memory (ctx); curhdr = ctx->hdrs[ctx->msgcount] = mutt_new_header (); - curhdr->received = t - tz; + curhdr->received = t - mutt_local_tz (t); curhdr->offset = loc; curhdr->index = ctx->msgcount; |