parse-datetime: fix failure to diagnose invalid input
authorJim Meyering <meyering@redhat.com>
Wed, 4 Jul 2012 10:58:07 +0000 (12:58 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 4 Jul 2012 10:58:07 +0000 (12:58 +0200)
commitd8f90adf5f01512958b6da46bd5eea01294a434e
treea893b72d7893ad2b063b9be0a2774d6ff8ba0679
parentd0ea2a12f6fb377f930886d404f3dfc2a732537d
parse-datetime: fix failure to diagnose invalid input

date -d "$(printf '\xb0')" would print 00:00:00 with today's date
rather than diagnosing the invalid input.  Now it reports this:
date: invalid date '\260'
* lib/parse-datetime.y (to_uchar): Define.
(yylex): Don't sign-extend "other" bytes.
* m4/parse-datetime.m4: Require AC_C_INLINE for first use of "inline".
Thanks to Bruno Haible for the patch to this file.
* tests/test-parse-datetime.c (main): Add a test to trigger the bug.
Peter Evans reported the bug in GNU date: http://bugs.gnu.org/11843
ChangeLog
lib/parse-datetime.y
m4/parse-datetime.m4
tests/test-parse-datetime.c