Hello, While writing a set of regression tests for calendar(1) I discovered a bug introduced by my last patch. The following patch fixes that and all regression tests in the attachment of tests passes.
Thanks,
Andy
Index: day.c
===================================================================
RCS file: /home/cvs/src/usr.bin/calendar/day.c,v
retrieving revision 1.33
diff -u -p -r1.33 day.c
--- day.c 13 Jul 2016 21:32:01 -0000 1.33
+++ day.c 31 Aug 2016 13:40:01 -0000
@@ -543,7 +543,9 @@ isnow(char *endp, int bodun)
tdiff = difftime(ttmp, f_time)/ SECSPERDAY;
if (tdiff <= offset + f_dayAfter ||
(bodun && tdiff == -1)) {
- if ((tmtmp.tm_mon == month) &&
+ if (((tmtmp.tm_mon == month) ||
+ (flags & F_SPECIAL) ||
+ (interval == WEEKLY)) &&
(tdiff >= 0 ||
(bodun && tdiff == -1))) {
if ((tmp = malloc(sizeof(struct
match))) == NULL)
calendar-regress.tar.gz
Description: calendar-regress.tar.gz
