Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time Add UTC as a synonym for GMT (%Z). [from Free...
details: https://anonhg.NetBSD.org/src/rev/4fe854cf1963
branches: trunk
changeset: 337207:4fe854cf1963
user: ginsbach <ginsbach%NetBSD.org@localhost>
date: Mon Apr 06 14:38:22 2015 +0000
description:
Add UTC as a synonym for GMT (%Z). [from FreeBSD]
diffstat:
lib/libc/time/strptime.3 | 10 ++++++----
lib/libc/time/strptime.c | 7 ++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diffs (59 lines):
diff -r e354771315c4 -r 4fe854cf1963 lib/libc/time/strptime.3
--- a/lib/libc/time/strptime.3 Mon Apr 06 14:36:41 2015 +0000
+++ b/lib/libc/time/strptime.3 Mon Apr 06 14:38:22 2015 +0000
@@ -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 @@
.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
diff -r e354771315c4 -r 4fe854cf1963 lib/libc/time/strptime.c
--- a/lib/libc/time/strptime.c Mon Apr 06 14:36:41 2015 +0000
+++ b/lib/libc/time/strptime.c Mon Apr 06 14:38:22 2015 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index