]> git.ipfire.org Git - thirdparty/glibc.git/commit
mktime: improve heuristic for ca-1986 Indiana DST
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 9 Sep 2022 01:08:32 +0000 (20:08 -0500)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 9 Sep 2022 03:55:54 +0000 (22:55 -0500)
commit83859e1115269cf56d21669361d4ddbe2687831c
tree39a225e7d9bea9a0eccdbbe075faf03de61f75b2
parent82a1ec851025ccae54dea43149915707f890746b
mktime: improve heuristic for ca-1986 Indiana DST

This patch syncs mktime.c from Gnulib, fixing a
problem reported by Mark Krenz <https://bugs.gnu.org/48085>,
and it should fix BZ#29035 too.
* time/mktime.c (__mktime_internal): Be more generous about
accepting arguments with the wrong value of tm_isdst, by falling
back to a one-hour DST difference if we find no nearby DST that is
unusual.  This fixes a problem where "1986-04-28 00:00 EDT" was
rejected when TZ="America/Indianapolis" because the nearest DST
timestamp occurred in 1970, a temporal distance too great for the
old heuristic.  This also also narrows the search a bit, which
is a minor performance win.
time/mktime.c