Source-Changes-HG archive

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

[src/trunk]: src/lib/libutil preserve a copy of the tm so we can check later.



details:   https://anonhg.NetBSD.org/src/rev/1cfa18447779
branches:  trunk
changeset: 342135:1cfa18447779
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Dec 08 12:51:04 2015 +0000

description:
preserve a copy of the tm so we can check later.

diffstat:

 lib/libutil/parsedate.y |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 0db7b4aca3c7 -r 1cfa18447779 lib/libutil/parsedate.y
--- a/lib/libutil/parsedate.y   Tue Dec 08 12:41:28 2015 +0000
+++ b/lib/libutil/parsedate.y   Tue Dec 08 12:51:04 2015 +0000
@@ -14,7 +14,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.23 2015/12/07 20:55:49 christos Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.24 2015/12/08 12:51:04 christos Exp $");
 #endif
 
 #include <stdio.h>
@@ -675,10 +675,12 @@
            case DSToff: tm.tm_isdst = 0; break;
            default:     tm.tm_isdst = -1; break;
            }
+           otm = tm;
            result = mktime(&tm);
     } else {
            /* We rely on mktime_z(NULL, ...) working in UTC */
            tm.tm_isdst = 0;    /* hence cannot be summer time */
+           otm = tm;
            errno = 0;
            result = mktime_z(NULL, &tm);
            if (result != -1 || errno == 0) {



Home | Main Index | Thread Index | Old Index