diff options
author | Ken Murchison <murch@fastmail.com> | 2021-09-22 09:14:21 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2021-09-22 10:12:31 -0400 |
commit | 2d2c44a58f93c47d8d4fa3e9b1d95a492ef70c6e (patch) | |
tree | 876671eeae5af7997f533bbe24e29aa739e395f3 /src | |
parent | a05b2d39497d00b37ee9d3f2a7bdcc5b5100fb6e (diff) | |
download | libical-git-2d2c44a58f93c47d8d4fa3e9b1d95a492ef70c6e.tar.gz |
icalrecur.c: look harder for tzid and protect against not finding it
Diffstat (limited to 'src')
-rw-r--r-- | src/libical/icalrecur.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libical/icalrecur.c b/src/libical/icalrecur.c index 10d6125b..522fe28d 100644 --- a/src/libical/icalrecur.c +++ b/src/libical/icalrecur.c @@ -1471,9 +1471,18 @@ static int initialize_rscale(icalrecur_iterator *impl) UChar *tzid = (UChar *) UCAL_UNKNOWN_ZONE_ID; short is_hebrew = 0; - if (dtstart.zone) { - /* Convert the UTF8 timezoneid of dstart to ICU UChar. */ - const char *src = icaltimezone_get_tzid((icaltimezone *) dtstart.zone); + /* Convert the UTF8 timezoneid of dstart to ICU UChar. */ + const char *src = icaltimezone_get_location((icaltimezone *) dtstart.zone); + if (!src) { + const char *prefix = icaltimezone_tzid_prefix(); + + src = icaltimezone_get_tzid((icaltimezone *) dtstart.zone); + if (src && !strncmp(src, prefix, strlen(prefix))) { + /* Skip past our prefix */ + src += strlen(prefix); + } + } + if (src) { size_t len = (strlen(src) + 1) * U_SIZEOF_UCHAR; tzid = icalmemory_tmp_buffer(len); tzid = u_strFromUTF8Lenient(tzid, (int32_t)len, NULL, src, -1, &status); |