From 92c52644e04ac754b1b282a9d33d033e04e1399e Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 27 Aug 2018 18:17:20 -0500 Subject: [PATCH] time: fix incorrect DST offset when using POSIX timezones without DST This manifests itself in mktime if tm_isdst = 1 and the current TZ= is a POSIX timezone specification. mktime would see that tm_isdst was set to 0 by __secs_to_zone, and subtract 'oppoff' (dst_off) - gmtoff from the resultant time. This meant that mktime returned a time that was exactly double the GMT offset of the desired timezone when tm_isdst was = 1. --- src/time/__tz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index 1dbb0b8f..814edcdf 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -230,7 +230,7 @@ static void do_tzset() dst_off = __timezone - 3600; } else { __daylight = 0; - dst_off = 0; + dst_off = __timezone; } if (*s == ',') s++, getrule(&s, r0); -- 2.25.1