diff options
author | melifaro <melifaro@FreeBSD.org> | 2014-10-06 11:29:50 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2014-10-06 11:29:50 +0000 |
commit | bbf0fe2f55e3258afdcf4e34c9b1b3e7022313ec (patch) | |
tree | 854ad5abba35f75bf0897714c147006029a7ec67 /lib/libc | |
parent | 6d4e1e4f7b52f1c8a619c0543a842d2c32fc4b08 (diff) | |
parent | 1a9bf52407392314013176555802b13a04699792 (diff) | |
download | FreeBSD-src-bbf0fe2f55e3258afdcf4e34c9b1b3e7022313ec.zip FreeBSD-src-bbf0fe2f55e3258afdcf4e34c9b1b3e7022313ec.tar.gz |
Sync to HEAD@r272609.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdtime/strptime.3 | 3 | ||||
-rw-r--r-- | lib/libc/stdtime/strptime.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index 27054460..2b50f0e 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -79,7 +79,8 @@ and .Fa \&%D , are now interpreted as beginning at 1969 per POSIX requirements. Years 69-00 are interpreted in the 20th century (1969-2000), years -01-68 in the 21st century (2001-2068). The +01-68 in the 21st century (2001-2068). +The .Fa \&%U and .Fa %W diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 8576bdb..55c9960 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -552,7 +552,8 @@ label: strncpy(zonestr, buf, cp - buf); zonestr[cp - buf] = '\0'; tzset(); - if (0 == strcmp(zonestr, "GMT")) { + if (0 == strcmp(zonestr, "GMT") || + 0 == strcmp(zonestr, "UTC")) { *GMTp = 1; } else if (0 == strcmp(zonestr, tzname[0])) { tm->tm_isdst = 0; @@ -674,6 +675,9 @@ strptime_l(const char * __restrict buf, const char * __restrict fmt, ret = _strptime(buf, fmt, tm, &gmt, loc); if (ret && gmt) { time_t t = timegm(tm); + + if (t == -1) + return (NULL); localtime_r(&t, tm); } |