diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2013-10-25 19:04:47 +0200 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2013-10-25 19:05:24 +0200 |
commit | ddc7e412ab252e7360a4357664beb3b5d9c4f42b (patch) | |
tree | 9e407ff2bbd78edb2bb1c59298d45636f123b3c2 /time | |
parent | ca42d35ea1a4b69b11a3b9a3e3bd1390470d188f (diff) | |
download | glibc-ddc7e412ab252e7360a4357664beb3b5d9c4f42b.zip glibc-ddc7e412ab252e7360a4357664beb3b5d9c4f42b.tar.gz glibc-ddc7e412ab252e7360a4357664beb3b5d9c4f42b.tar.bz2 |
Make strptime %Z consistent between doc and code. Fixes bug 14876
Diffstat (limited to 'time')
-rw-r--r-- | time/strptime_l.c | 6 | ||||
-rw-r--r-- | time/tst-strptime.c | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/time/strptime_l.c b/time/strptime_l.c index 00fc1ef..c2c2ee8 100644 --- a/time/strptime_l.c +++ b/time/strptime_l.c @@ -744,7 +744,11 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM) s.want_xday = 1; break; case 'Z': - /* XXX How to handle this? */ + /* Read timezone but perform no conversion. */ + while (ISSPACE (*rp)) + rp++; + while (!ISSPACE (*rp) && *rp != '\0') + rp++; break; case 'z': /* We recognize two formats: if two digits are given, these diff --git a/time/tst-strptime.c b/time/tst-strptime.c index 21fbb63..193f7db 100644 --- a/time/tst-strptime.c +++ b/time/tst-strptime.c @@ -41,6 +41,7 @@ static const struct { "C", "19990502123412", "%Y%m%d%H%M%S", 0, 121, 4, 2 }, { "C", "2001 20 Mon", "%Y %U %a", 1, 140, 4, 21 }, { "C", "2001 21 Mon", "%Y %W %a", 1, 140, 4, 21 }, + { "C", "2001 EST 21 Mon", "%Y %Z %W %a", 1, 140, 4, 21 }, { "C", "2012 00 Sun", "%Y %W %a", 0, 0, 0, 1 }, { "ja_JP.EUC-JP", "2000-01-01 08:12:21 AM", "%Y-%m-%d %I:%M:%S %p", 6, 0, 0, 1 }, |