bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date(1): -d argument parsing error


From: Eric Blake
Subject: Re: date(1): -d argument parsing error
Date: Wed, 10 Dec 2008 06:12:25 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18) Gecko/20081105 Thunderbird/2.0.0.18 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to James Youngman on 12/10/2008 3:08 AM:
> I'm normally reluctant to accept the need to change getdate.y (though
> this is not my call anyway of course, I'm not a maintainer) because of
> the fact that it's been around a long time and somebody somewhere may
> be relying on the current behaviour.  However, I also note that the
> "next <weekday-name>" is not currently tested by gnulib's
> tests/test-getdate.c program, and so it looks to me as if the weight
> of evidence favours changing this.  The difficulty of course is in not
> breaking something else.

As long as we're talking about getdate.y bugs, POSIX 2008 standardized the
'touch -d' option, and so we now need to fix getdate.y to parse the two
required formats:

YYYY-MM-DDThh:mm:SS[.frac][tz]
YYYY-MM-DDThh:mm:SS[,frac][tz]

    * YYYY are at least four decimal digits giving the year.
    * MM, DD, hh, mm, and SS are as with -t time.
    * T is the time designator, and can be replaced by a single <space>.
    * [.frac] and [,frac] are either empty, or a <period> ( '.' ) or a
<comma> ( ',' ) respectively, followed by one or more decimal digits,
specifying a fractional second.
    * [tz] is either empty, signifying local time, or the letter 'Z' ,
signifying UTC. If [tz] is empty, the resulting time shall be affected by
the value of the TZ environment variable.

http://www.opengroup.org/onlinepubs/9699919799/utilities/touch.html

But getdate, and thus coreutils' touch and date programs, currently choke
when using a literal "T" instead of " " in the T position.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk/wDkACgkQ84KuGfSFAYDrZACgiax+/Sr3V3JJ5EFVDBvjvwAK
Ke4AoLs69yckh1DQTkvuxG0E+6zbVfPL
=mBne
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]