]> Savannah Git Hosting - gnulib.git/commit
parse-datetime: allow calculations to yield -1
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Feb 2022 19:05:44 +0000 (11:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Feb 2022 19:06:29 +0000 (11:06 -0800)
commitaa0d1e7800903f2d75432d78aa64a0e9770e83f2
treec127bfdf8f154347d077c225aeb070999f378a68
parentff208d546a26fee39a0191297c11560da74b5dee
parse-datetime: allow calculations to yield -1

Problem reported by Jeremy Cantrell <https://bugs.gnu.org/50115>.
* lib/parse-datetime.y (parse_datetime_body): When calling mktime,
use an unmodifed and negative tm_wday or tm_yday to detect an error,
as a (time_t) -1 return value is valid on most hosts.
* tests/test-parse-datetime.c (main): Add a test for the bug.
ChangeLog
lib/parse-datetime.y
tests/test-parse-datetime.c