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>
This commit is contained in:
parent
5fbc499886
commit
a0305d754f
@ -525,10 +525,11 @@ int date_change(struct tm *date, int delta_month, int delta_day)
|
|||||||
t = *date;
|
t = *date;
|
||||||
t.tm_mon += delta_month;
|
t.tm_mon += delta_month;
|
||||||
t.tm_mday += delta_day;
|
t.tm_mday += delta_day;
|
||||||
|
t.tm_isdst = -1;
|
||||||
if (mktime(&t) == -1) {
|
if (mktime(&t) == -1) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
t.tm_isdst = -1;
|
||||||
*date = t;
|
*date = t;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user