aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-03-28 08:45:49 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2016-03-28 08:45:49 +0200
commit4633846550a1efd3a758e51551b6a93446b2297d (patch)
tree09f69fd34e85fe03bc1ac446af9bc16820c9fe02
parent9e160fac16e81c42ac368f450b9cc4df29753e00 (diff)
downloadcalcurse-4633846550a1efd3a758e51551b6a93446b2297d.tar.gz
calcurse-4633846550a1efd3a758e51551b6a93446b2297d.zip
Fix apoint_inday() with long appointments
Fixes a regression introduced in 9e160fa (Do not assume that days always have 86400 seconds, 2016-03-27). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/apoint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apoint.c b/src/apoint.c
index 409e889..97f23fb 100644
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -119,7 +119,8 @@ struct apoint *apoint_new(char *mesg, char *note, long start, long dur,
unsigned apoint_inday(struct apoint *i, long *start)
{
- return (date_cmp_day(i->start, *start) == 0);
+ return (date_cmp_day(i->start, *start) <= 0 &&
+ date_cmp_day(i->start + i->dur - 1, *start) >= 0);
}
void apoint_sec2str(struct apoint *o, long day, char *start, char *end)