summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2017-07-04 09:57:20 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-07-04 09:57:20 (GMT)
commit057f5b589dc1fb36be0a5c554b8839d49046e52f (patch) (side-by-side diff)
treea5da72ebb6a943e27bcd76040ab7effb97951ce5
parent3fc6fc8ae9fe5980abf25e109c96934cb1fdb1eb (diff)
downloadmailutils-057f5b589dc1fb36be0a5c554b8839d49046e52f.tar.gz
mailutils-057f5b589dc1fb36be0a5c554b8839d49046e52f.tar.bz2
mu_parse_date_dtl: Minor fix
* libmailutils/datetime/parsedate.y (mu_parse_date_dtl): Set tm.tm_gmtoff and tm.tm_zone upon return (if present).
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libmailutils/datetime/parsedate.y19
1 files changed, 15 insertions, 4 deletions
diff --git a/libmailutils/datetime/parsedate.y b/libmailutils/datetime/parsedate.y
index a422d59..e8eddd6 100644
--- a/libmailutils/datetime/parsedate.y
+++ b/libmailutils/datetime/parsedate.y
@@ -1170,6 +1170,19 @@ mu_parse_date_dtl (const char *p, const time_t *now,
start += delta;
}
}
+
+ if (MASK_TEST (pd.date.mask, MU_PD_MASK_TZ))
+ {
+ pd.date.tz = - pd.date.tz * 60L;
+ if (!pd.date.tzname)
+ pd.date.tzname = tm.tm_isdst != -1 ? tzname[tm.tm_isdst] : NULL;
+#if HAVE_STRUCT_TM_TM_GMTOFF
+ tm.tm_gmtoff = pd.date.tz;
+#endif
+#if HAVE_STRUCT_TM_TM_ZONE
+ tm.tm_zone = pd.date.tzname;
+#endif
+ }
if (rettime)
*rettime = start;
if (rettm)
@@ -1178,10 +1191,8 @@ mu_parse_date_dtl (const char *p, const time_t *now,
{
if (MASK_TEST (pd.date.mask, MU_PD_MASK_TZ))
{
- rettz->utc_offset = - pd.date.tz * 60L;
- rettz->tz_name = pd.date.tzname
- ? pd.date.tzname
- : (tm.tm_isdst != -1 ? tzname[tm.tm_isdst] : NULL);
+ rettz->utc_offset = pd.date.tz;
+ rettz->tz_name = pd.date.tzname;
}
else
{

Return to:

Send suggestions and report system problems to the System administrator.