[PATCH] time: in strptime(), make %z accept Z as a time zone

Mike Frysinger vapier@gentoo.org
Fri Mar 6 10:11:00 GMT 2015


On 27 Jan 2015 16:05, Vincent Bernat wrote:
> In ISO 8601, the timezone can be 'Z' instead of using
> digits. 2014-08-17T12:33:12+0000 is often expressed as
> 2014-08-17T12:33:12Z.

code wise, this looks good to me.  style problems though ...

> --- a/time/strptime_l.c
> +++ b/time/strptime_l.c
>
> -	     also specified.  */
> +	     also specified. 'Z' is equivalent to +0000. */

GNU style puts two spaces after the period

>  	  {
>  	    val = 0;
>  	    while (ISSPACE (*rp))
>  	      ++rp;
> +            if (*rp == 'Z')
> +              {
> +                rp++;
> +                break;
> +              }

indentation is incorrect -- you need to start with a tab

minor nit: this code would do ++rp instead of rp++
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150306/7d2f8574/attachment.sig>


More information about the Libc-alpha mailing list