]> Savannah Git Hosting - gnulib.git/commit
mktime: improve heuristic for ca-1986 Indiana DST
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Feb 2022 23:04:43 +0000 (15:04 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Feb 2022 23:28:11 +0000 (15:28 -0800)
commit06b2e943be39284783ff81ac6c9503200f41dba3
tree05f59fa34157a79ebaef39a3433838da9b7d5540
parent9f48fb992a3d7e96610c4ce8be969cff2d61a01b
mktime: improve heuristic for ca-1986 Indiana DST

Problem reported by Mark Krenz <https://bugs.gnu.org/48085>.
* lib/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.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS):
Check for putenv failures and for Bug#48085.
* tests/test-parse-datetime.c (main):
Test for setenv failures and for Bug#48085.
ChangeLog
lib/mktime.c
m4/mktime.m4
tests/test-parse-datetime.c