summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2006-05-30 04:00:23 +0000
committergrog <grog@FreeBSD.org>2006-05-30 04:00:23 +0000
commit4484b1feb36b9ad05cf3cc0c984e6b2fb147ae7d (patch)
tree76b378498af04ba44f37176636e80ecb4320b6d2 /usr.bin
parent348c115abbf2947f0649f61cb768f3e6ae766c2e (diff)
downloadFreeBSD-src-4484b1feb36b9ad05cf3cc0c984e6b2fb147ae7d.zip
FreeBSD-src-4484b1feb36b9ad05cf3cc0c984e6b2fb147ae7d.tar.gz
Don't go past the end of the month with a repetitive entry of the
style "every Monday": mon * Do Foo. Previously, at the end of the month, this could cause a printout of the following nature when invoked with -A 7: 36 May* Do Foo MFC after: 2 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/calendar/day.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c
index cbc1966..8c90d5c 100644
--- a/usr.bin/calendar/day.c
+++ b/usr.bin/calendar/day.c
@@ -376,6 +376,9 @@ isnow(endp, monthp, dayp, varp)
#ifdef DEBUG
fprintf(stderr, "day2: day %d(%d-%d) yday %d\n", *dayp, day, cumdays[month], tp->tm_yday);
#endif
+ if (day > cumdays [month + 1]) /* off end of month */
+ return (0);
+
/* if today or today + offset days */
if (day >= tp->tm_yday - f_dayBefore &&
day <= tp->tm_yday + offset + f_dayAfter)
OpenPOWER on IntegriCloud