]> 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)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 22:44:30 +0000 (00:44 +0200)
commit007812fae9109a5ad611b8a9378340de1de55b28
tree237d3f20fe62d2e94ace9670b18e70647826b92a
parentc2e9173fa8ee5c8e0430b9c549f0ae4c6a7654a3
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