diff options
author | Allen Winter <allen.winter@kdab.com> | 2015-06-22 18:49:32 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2015-06-22 18:49:32 -0400 |
commit | 30da7468e4c79ad69ea90a43bc6f71c70c8df751 (patch) | |
tree | eff16a2f1ae8451cbc307c8652c126e2c35891b1 | |
parent | 381029504deb0c7062b649badc9290b35a564b5f (diff) | |
parent | b63ef21fd9966ee33d07f4b02c97a9b5f40af1b8 (diff) | |
download | libical-git-30da7468e4c79ad69ea90a43bc6f71c70c8df751.tar.gz |
Merge pull request #207 from ksuther/another-timezone-expansion-fix
Another timezone expansion fix
-rw-r--r-- | src/libical/icaltimezone.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libical/icaltimezone.c b/src/libical/icaltimezone.c index 76923494..9f73e927 100644 --- a/src/libical/icaltimezone.c +++ b/src/libical/icaltimezone.c @@ -840,7 +840,7 @@ int icaltimezone_get_utc_offset(icaltimezone *zone, struct icaltimetype *tt, int break; /* If we go past the start of the changes array, then we have no data - for this time so we return the prev UTC offset. */ + for this time so we return the prev UTC offset. */ if (change_num == 0 && step < 0) { if (is_daylight) { *is_daylight = ! tmp_change.is_daylight; @@ -974,6 +974,15 @@ int icaltimezone_get_utc_offset_of_utc_time(icaltimezone *zone, if (step == -1 && found_change == 1) break; + /* If we go past the start of the changes array, then we have no data + for this time so we return the prev UTC offset. */ + if (change_num == 0 && step < 0) { + if (is_daylight) { + *is_daylight = ! tmp_change.is_daylight; + } + return tmp_change.prev_utc_offset; + } + change_num += step; if (change_num >= zone->changes->num_elements) |