mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Handle another time zone edge case.
This commit is contained in:
10
src/dorem.c
10
src/dorem.c
@@ -135,11 +135,15 @@ void EnterTimezone(char const *tz)
|
||||
/* Update our variables */
|
||||
(void) localtime_r(&t, &tm);
|
||||
|
||||
SysTime = tm.tm_min * 60 + (tm.tm_hour * 3600);
|
||||
CurDay = tm.tm_mday;
|
||||
CurMon = tm.tm_mon;
|
||||
CurYear = tm.tm_year + 1900;
|
||||
DSEToday = DSE(CurYear, CurMon, CurDay);
|
||||
SysTime = tm.tm_min * 60 + (tm.tm_hour * 3600);
|
||||
/* Adjust DSEToday back by a day if midnight in our time zone requires it */
|
||||
if (SysTime < LocalSysTime) {
|
||||
DSEToday--;
|
||||
FromDSE(DSEToday, &CurYear, &CurMon, &CurDay);
|
||||
}
|
||||
|
||||
if (DebugFlag & DB_SWITCH_ZONE) {
|
||||
fprintf(stderr, "TZ enter %s: %04d-%02d-%02d %02d:%02d\n", tz,
|
||||
@@ -1089,7 +1093,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
|
||||
return E_TZ_SPECIFIED_TWICE;
|
||||
}
|
||||
|
||||
r = ParseQuotedString(s, &buf);
|
||||
r = ParseTokenOrQuotedString(s, &buf);
|
||||
if (r != OK) {
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -4297,14 +4297,13 @@ FMultiTrig(func_info *info)
|
||||
Eprint(tr("Cannot use AT clause in multitrig() function"));
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
EnterTimezone(trig.tz);
|
||||
dse = ComputeTrigger(get_scanfrom(&trig), &trig, &tim, &r, 0);
|
||||
ExitTimezone(trig.tz);
|
||||
|
||||
/* multitrig only does untimed reminders, so no need to worry
|
||||
about time zones */
|
||||
DestroyParser(&p);
|
||||
|
||||
if (r != E_CANT_TRIG) {
|
||||
dse = AdjustTriggerForTimeZone(&trig, dse, &tim);
|
||||
if (dse < earliest || earliest < 0) {
|
||||
earliest = dse;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user