diff options
author | Ken Murchison <murch@fastmail.com> | 2020-11-05 17:16:21 -0500 |
---|---|---|
committer | Ken Murchison <murch@fastmail.com> | 2020-11-05 17:16:21 -0500 |
commit | 3bfbe8b97a904cc7951c0b82d41d2f4e70f01b8b (patch) | |
tree | ab9f15070ed1c1033ccb29ea7526dd8c1c0b397d | |
parent | fab38e944eebe4ec07a022323d9fd939b61b013f (diff) | |
download | libical-git-3bfbe8b97a904cc7951c0b82d41d2f4e70f01b8b.tar.gz |
icalrecur.c: properly handle multiple BYWEEKNO values
-rw-r--r-- | src/libical/icalrecur.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libical/icalrecur.c b/src/libical/icalrecur.c index f48d063b..f8f42d71 100644 --- a/src/libical/icalrecur.c +++ b/src/libical/icalrecur.c @@ -2417,7 +2417,7 @@ static int expand_by_day(icalrecur_iterator *impl, int year, /* Add instance(s) of the weekday within the period */ do { - int valid = 1; + int valid = 0; if (has_by_data(impl, BY_WEEK_NO)) { /* Make sure our day falls in one of the BYWEEKNO */ @@ -2426,9 +2426,13 @@ static int expand_by_day(icalrecur_iterator *impl, int year, for (j = 0; BYWEEKPTR[j] != ICAL_RECURRENCE_ARRAY_MAX; j++) { int weekno = BYWEEKPTR[j]; - if (weekno != this_weekno) valid = 0; + if (weekno == this_weekno) { + valid = 1; + break; + } } } + else valid = 1; if (valid) { daysmask_setbit(bydays, day + doy_offset, 1); |