Module Name: src
Committed By: ginsbach
Date: Mon Apr 6 14:38:22 UTC 2015
Modified Files:
src/lib/libc/time: strptime.3 strptime.c
Log Message:
Add UTC as a synonym for GMT (%Z). [from FreeBSD]
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/time/strptime.3
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/time/strptime.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/time/strptime.3
diff -u src/lib/libc/time/strptime.3:1.30 src/lib/libc/time/strptime.3:1.31
--- src/lib/libc/time/strptime.3:1.30 Fri Apr 3 15:52:50 2015
+++ src/lib/libc/time/strptime.3 Mon Apr 6 14:38:22 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: strptime.3,v 1.30 2015/04/03 15:52:50 ginsbach Exp $
+.\" $NetBSD: strptime.3,v 1.31 2015/04/06 14:38:22 ginsbach Exp $
.\"
.\" Copyright (c) 1997, 1998, 2008 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -26,7 +26,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd April 3, 2015
+.Dd April 6, 2015
.Dt STRPTIME 3
.Os
.Sh NAME
@@ -335,8 +335,10 @@ The
.Cm \&%Z
format specifier only accepts time zone
abbreviations of the local time zone,
-or the value
-.Dq GMT .
+or the values
+.Dq GMT
+or
+.Dq UTC .
This limitation is caused by the ambiguity
of overloaded time zone abbreviations,
for example EST is both Eastern Standard
Index: src/lib/libc/time/strptime.c
diff -u src/lib/libc/time/strptime.c:1.38 src/lib/libc/time/strptime.c:1.39
--- src/lib/libc/time/strptime.c:1.38 Fri May 17 12:55:57 2013
+++ src/lib/libc/time/strptime.c Mon Apr 6 14:38:22 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: strptime.c,v 1.38 2013/05/17 12:55:57 joerg Exp $ */
+/* $NetBSD: strptime.c,v 1.39 2015/04/06 14:38:22 ginsbach Exp $ */
/*-
* Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.38 2013/05/17 12:55:57 joerg Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.39 2015/04/06 14:38:22 ginsbach Exp $");
#endif
#include "namespace.h"
@@ -357,7 +357,8 @@ literal:
case 'Z':
tzset();
- if (strncmp((const char *)bp, gmt, 3) == 0) {
+ if (strncmp((const char *)bp, gmt, 3) == 0 ||
+ strncmp((const char *)bp, utc, 3) == 0) {
tm->tm_isdst = 0;
#ifdef TM_GMTOFF
tm->TM_GMTOFF = 0;