* lib/parse-datetime.y (parse_datetime2): If we parse
all of the input but determine it's invalid, ensure
we don't output the now invalid input pointer.
This issue was seen with `date -d 'now +1'`.
+2016-09-08 Pádraig Brady <P@draigBrady.com>
+
+ parse-datetime: restrict debug output to input string
+ * lib/parse-datetime.y (parse_datetime2): If we parse
+ all of the input but determine it's invalid, ensure
+ we don't output the now invalid input pointer.
+ This issue was seen with `date -d 'now +1'`.
+
2016-09-07 Paul Eggert <eggert@cs.ucla.edu>
flexmember: new macro FLEXALIGNOF
bool ok = true;
char dbg_ord[DBGBUFSIZE];
char dbg_tm[DBGBUFSIZE];
+ char const *input_sentinel = p + strlen (p);
if (! now)
{
if (yyparse (&pc) != 0)
{
if (pc.parse_datetime_debug)
- dbg_printf (_("error: parsing failed, stopped at '%s'\n"), pc.input);
+ {
+ if (input_sentinel <= pc.input)
+ dbg_printf (_("error: parsing failed\n"), pc.input);
+ else
+ {
+ dbg_printf (_("error: parsing failed, stopped at '%s'\n"),
+ pc.input);
+ }
+ }
goto fail;
}