Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time Fix a couple comments and a spacing nit.



details:   https://anonhg.NetBSD.org/src/rev/3d8f5bc16e82
branches:  trunk
changeset: 826036:3d8f5bc16e82
user:      ginsbach <ginsbach%NetBSD.org@localhost>
date:      Sat Aug 12 03:29:23 2017 +0000

description:
Fix a couple comments and a spacing nit.

- Change a XXX comment that no longer applies.
- Add a clarifying comment.

diffstat:

 lib/libc/time/strptime.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r b4b8a0eb25d1 -r 3d8f5bc16e82 lib/libc/time/strptime.c
--- a/lib/libc/time/strptime.c  Sat Aug 12 01:10:04 2017 +0000
+++ b/lib/libc/time/strptime.c  Sat Aug 12 03:29:23 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strptime.c,v 1.60 2016/05/15 20:37:48 christos Exp $   */
+/*     $NetBSD: strptime.c,v 1.61 2017/08/12 03:29:23 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.60 2016/05/15 20:37:48 christos Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.61 2017/08/12 03:29:23 ginsbach Exp $");
 #endif
 
 #include "namespace.h"
@@ -382,10 +382,10 @@
                case 'U':       /* The week of year, beginning on sunday. */
                case 'W':       /* The week of year, beginning on monday. */
                        /*
-                        * XXX This is bogus, as we can not assume any valid
+                        * This is bogus, as we can not assume any valid
                         * information present in the tm structure at this
-                        * point to calculate a real value, so just check the
-                        * range for now.
+                        * point to calculate a real value, so save the
+                        * week for now in case it can be used later.
                         */
                        bp = conv_num(bp, &i, 0, 53);
                        LEGAL_ALT(ALT_O);
@@ -516,7 +516,7 @@
                                /* Nautical / Military style */
                                if (delim(bp[1]) &&
                                    ((*bp >= 'A' && *bp <= 'I') ||
-                                   (*bp >= 'L' && *bp <= 'Y'))) {
+                                    (*bp >= 'L' && *bp <= 'Y'))) {
 #ifdef TM_GMTOFF
                                        /* Argh! No 'J'! */
                                        if (*bp >= 'A' && *bp <= 'I')
@@ -635,6 +635,7 @@
                                bp = zname;
                                continue;
                        }
+                       /* ISO 8601 & RFC 3339 limit to 23:59 max */
                        if (offs >= (HOURSPERDAY * SECSPERHOUR))
                                goto out;
                        if (neg)



Home | Main Index | Thread Index | Old Index