aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-11-26 02:04:29 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-11-26 02:04:29 +0100
commit4e28e8a9cc2ce6e81833d71270a74f0f55a540fc (patch)
tree5e871e3920ad43e57994d2a1137e3cb38f28ad93
parent9a6b875b1d6876db30d3e3438ed28dd460970025 (diff)
parent7f16e1c1d30f56d796b1e7f2286c9ccfdd97061f (diff)
downloadcalcurse-4e28e8a9cc2ce6e81833d71270a74f0f55a540fc.tar.gz
calcurse-4e28e8a9cc2ce6e81833d71270a74f0f55a540fc.zip
Merge branch 'maint'
-rw-r--r--src/day.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/day.c b/src/day.c
index 978e9d2..df95ccf 100644
--- a/src/day.c
+++ b/src/day.c
@@ -622,6 +622,11 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
long start = get_item_time(rapt->start);
long end = get_item_time(rapt->start + rapt->dur);
+ if (rapt->start < date)
+ start = 0;
+ if (rapt->start + rapt->dur >= date + DAYINSEC)
+ end = DAYINSEC - 1;
+
if (!fill_slices(slices, slicesno, SLICENUM(start), SLICENUM(end))) {
LLIST_TS_UNLOCK(&recur_alist_p);
return 0;
@@ -637,6 +642,10 @@ unsigned day_chk_busy_slices(struct date day, int slicesno, int *slices)
if (apt->start >= date + DAYINSEC)
break;
+ if (apt->start < date)
+ start = 0;
+ if (apt->start + apt->dur >= date + DAYINSEC)
+ end = DAYINSEC - 1;
if (!fill_slices(slices, slicesno, SLICENUM(start), SLICENUM(end))) {
LLIST_TS_UNLOCK(&alist_p);