summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-07-04 12:57:20 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-07-04 12:57:20 +0300
commit057f5b589dc1fb36be0a5c554b8839d49046e52f (patch)
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).
-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 a422d59d2..e8eddd6b8 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,
1170 start += delta; 1170 start += delta;
1171 } 1171 }
1172 } 1172 }
1173
1174 if (MASK_TEST (pd.date.mask, MU_PD_MASK_TZ))
1175 {
1176 pd.date.tz = - pd.date.tz * 60L;
1177 if (!pd.date.tzname)
1178 pd.date.tzname = tm.tm_isdst != -1 ? tzname[tm.tm_isdst] : NULL;
1179#if HAVE_STRUCT_TM_TM_GMTOFF
1180 tm.tm_gmtoff = pd.date.tz;
1181#endif
1182#if HAVE_STRUCT_TM_TM_ZONE
1183 tm.tm_zone = pd.date.tzname;
1184#endif
1185 }
1173 if (rettime) 1186 if (rettime)
1174 *rettime = start; 1187 *rettime = start;
1175 if (rettm) 1188 if (rettm)
@@ -1178,10 +1191,8 @@ mu_parse_date_dtl (const char *p, const time_t *now,
1178 { 1191 {
1179 if (MASK_TEST (pd.date.mask, MU_PD_MASK_TZ)) 1192 if (MASK_TEST (pd.date.mask, MU_PD_MASK_TZ))
1180 { 1193 {
1181 rettz->utc_offset = - pd.date.tz * 60L; 1194 rettz->utc_offset = pd.date.tz;
1182 rettz->tz_name = pd.date.tzname 1195 rettz->tz_name = pd.date.tzname;
1183 ? pd.date.tzname
1184 : (tm.tm_isdst != -1 ? tzname[tm.tm_isdst] : NULL);
1185 } 1196 }
1186 else 1197 else
1187 { 1198 {

Return to:

Send suggestions and report system problems to the System administrator.