34 lines
884 B
Diff
34 lines
884 B
Diff
From d6fd07785fe8072e6bbadc173e9d6a2e73efdcdd Mon Sep 17 00:00:00 2001
|
|
From: Lars Henriksen <LarsHenriksen@get2net.dk>
|
|
Date: Thu, 1 Aug 2019 07:19:14 +0200
|
|
Subject: DST: fix date_change() thoroughly
|
|
|
|
Explicit setting of Daylight Saving Time should be avoided before as well as
|
|
after the mktime() call.
|
|
|
|
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
|
|
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
|
|
---
|
|
src/utils.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/utils.c b/src/utils.c
|
|
index 8a8de75..a9a9e68 100644
|
|
--- src/utils.c
|
|
+++ src/utils.c
|
|
@@ -525,10 +525,11 @@ int date_change(struct tm *date, int delta_month, int delta_day)
|
|
t = *date;
|
|
t.tm_mon += delta_month;
|
|
t.tm_mday += delta_day;
|
|
-
|
|
+ t.tm_isdst = -1;
|
|
if (mktime(&t) == -1) {
|
|
return 1;
|
|
} else {
|
|
+ t.tm_isdst = -1;
|
|
*date = t;
|
|
return 0;
|
|
}
|
|
--
|
|
cgit v1.2.1
|
|
|