summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Murchison <murch@fastmail.com>2021-03-17 10:59:34 -0400
committerAllen Winter <allen.winter@kdab.com>2021-04-11 14:28:24 -0400
commit542bccc0571a26581e9b044fd0f526a5456be958 (patch)
treedf909da43b9ce4acd7a17c4bf0844de35b159c4c
parent33b3f82750e90f72126dacff4e1d2ecc270c7ff5 (diff)
downloadlibical-git-542bccc0571a26581e9b044fd0f526a5456be958.tar.gz
icaltz-util.c: need to check both offset from and to UTC
-rw-r--r--src/libical/icaltz-util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libical/icaltz-util.c b/src/libical/icaltz-util.c
index 44549281..c4db0bbf 100644
--- a/src/libical/icaltz-util.c
+++ b/src/libical/icaltz-util.c
@@ -366,6 +366,7 @@ struct zone_context {
enum icalcomponent_kind kind;
const char *name;
long gmtoff_from;
+ long gmtoff_to;
icaltimetype time;
icaltimetype prev_time;
@@ -405,11 +406,11 @@ icalcomponent *icaltzutil_fetch_timezone(const char *location)
icaltimetype icaltime;
struct zone_context standard =
- { ICAL_XSTANDARD_COMPONENT, NULL, LONG_MIN,
+ { ICAL_XSTANDARD_COMPONENT, NULL, LONG_MIN, LONG_MIN,
icaltime_null_time(), icaltime_null_time(),
NULL, NULL, {}, {} };
struct zone_context daylight =
- { ICAL_XDAYLIGHT_COMPONENT, NULL, LONG_MIN,
+ { ICAL_XDAYLIGHT_COMPONENT, NULL, LONG_MIN, LONG_MIN,
icaltime_null_time(), icaltime_null_time(),
NULL, NULL, {}, {} };
struct zone_context *zone;
@@ -720,6 +721,7 @@ icalcomponent *icaltzutil_fetch_timezone(const char *location)
}
// Check if the zone name or the offset has changed
else if (types[prev_idx].gmtoff != zone->gmtoff_from ||
+ types[idx].gmtoff != zone->gmtoff_to ||
strcmp(types[idx].zname, zone->name)) {
terminate = 1;
@@ -766,6 +768,7 @@ icalcomponent *icaltzutil_fetch_timezone(const char *location)
zone->prev_time = zone->time;
zone->time = icaltime;
zone->gmtoff_from = types[prev_idx].gmtoff;
+ zone->gmtoff_to = types[idx].gmtoff;
if (!zone->rrule_comp) {
zone->name = types[idx].zname;