summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2015-04-10 09:24:15 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2015-04-10 09:24:44 +0200
commit5ac3d43e9af1d901b0db6967999413a6e3364cc5 (patch)
treeeb548d06d06a980b1295f8bd90055772b130df82
parent80502f02de129de1f646ef2f3c2c143538b1574f (diff)
downloadcalcurse-5ac3d43e9af1d901b0db6967999413a6e3364cc5.zip
Fix slice computation of recurring appointments
Reported-by: HÃ¥kan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/day.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/day.c b/src/day.c
index 131119f..219d8a6 100644
--- a/src/day.c
+++ b/src/day.c
@@ -565,10 +565,15 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
LLIST_TS_LOCK(&recur_alist_p);
LLIST_TS_FIND_FOREACH(&recur_alist_p, (time_t *)&t,
recur_apoint_inday, i) {
- struct apoint *rapt = LLIST_TS_GET_DATA(i);
- long start = get_item_time(rapt->start);
+ struct recur_apoint *rapt = LLIST_TS_GET_DATA(i);
+ time_t occurrence;
+ long start;
long end = get_item_time(rapt->start + rapt->dur);
+ if (!recur_apoint_find_occurrence(rapt, t, &occurrence))
+ continue;
+ start = get_item_time(occurrence);
+
if (rapt->start < t)
start = 0;
if (rapt->start + rapt->dur >= t + DAYINSEC)