Mercurial > gnulib
changeset 29124:ed32cb7e45a7
Treat an empty date string exactly like "0".
* lib/getdate.y (get_date): Once any isspace or TZ= prefix is consumed,
if the remaining date string (to be parsed) is empty, use "0".
Reported by Mischa Molhoek and discussed in this thread:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/11726>.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Wed, 31 Oct 2007 20:32:07 +0100 |
parents | a7c7e7b53292 |
children | 6ce49881fa23 |
files | ChangeLog lib/getdate.y |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Oct 31 13:13:14 2007 +0100 +++ b/ChangeLog Wed Oct 31 20:32:07 2007 +0100 @@ -1,3 +1,11 @@ +2007-11-01 Jim Meyering <meyering@redhat.com> + + Treat an empty date string exactly like "0". + * lib/getdate.y (get_date): Once any isspace or TZ= prefix is consumed, + if the remaining date string (to be parsed) is empty, use "0". + Reported by Mischa Molhoek and discussed in this thread: + <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/11726>. + 2007-10-31 Bruno Haible <bruno@clisp.org> * m4/intmax_t.m4 (gl_AC_TYPE_INTMAX_T, gt_AC_TYPE_INTMAX_T): Use
--- a/lib/getdate.y Wed Oct 31 13:13:14 2007 +0100 +++ b/lib/getdate.y Wed Oct 31 20:32:07 2007 +0100 @@ -1238,6 +1238,12 @@ } } + /* As documented, be careful to treat the empty string just like + a date string of "0". Without this, an empty string would be + declared invalid when parsed during a DST transition. */ + if (*p == '\0') + p = "0"; + pc.input = p; pc.year.value = tmp->tm_year; pc.year.value += TM_YEAR_BASE;