summaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2015-12-08 12:51:04 +0000
committerchristos <christos@NetBSD.org>2015-12-08 12:51:04 +0000
commita66f877a003c746395b7c6cd693167d16f9b8a35 (patch)
treeefa1881f2d5bb28bdfe50818c083c573c82f2f54 /lib/libutil
parent9d39b0ab8574d6920506330c3f981bd8438deca4 (diff)
preserve a copy of the tm so we can check later.
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/parsedate.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libutil/parsedate.y b/lib/libutil/parsedate.y
index 2f6a9d4e6eb..34c968d18ee 100644
--- a/lib/libutil/parsedate.y
+++ b/lib/libutil/parsedate.y
@@ -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 @@ Convert(
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) {