Fix slice computation of recurring appointments
Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
80502f02de
commit
5ac3d43e9a
@ -565,10 +565,15 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
|
|||||||
LLIST_TS_LOCK(&recur_alist_p);
|
LLIST_TS_LOCK(&recur_alist_p);
|
||||||
LLIST_TS_FIND_FOREACH(&recur_alist_p, (time_t *)&t,
|
LLIST_TS_FIND_FOREACH(&recur_alist_p, (time_t *)&t,
|
||||||
recur_apoint_inday, i) {
|
recur_apoint_inday, i) {
|
||||||
struct apoint *rapt = LLIST_TS_GET_DATA(i);
|
struct recur_apoint *rapt = LLIST_TS_GET_DATA(i);
|
||||||
long start = get_item_time(rapt->start);
|
time_t occurrence;
|
||||||
|
long start;
|
||||||
long end = get_item_time(rapt->start + rapt->dur);
|
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)
|
if (rapt->start < t)
|
||||||
start = 0;
|
start = 0;
|
||||||
if (rapt->start + rapt->dur >= t + DAYINSEC)
|
if (rapt->start + rapt->dur >= t + DAYINSEC)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user