Subject: Re: bin/30107: [PATCH] calendar reports non-matching days.
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Johan Veenhuizen <veenhuizen@users.sourceforge.net>
List: netbsd-bugs
Date: 05/02/2006 10:55:03
The following reply was made to PR bin/30107; it has been noted by GNATS.
From: Johan Veenhuizen <veenhuizen@users.sourceforge.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: bin/30107: [PATCH] calendar reports non-matching days.
Date: Tue, 02 May 2006 12:53:03 +0200
Could somebody please apply the following patch and close this PR?
calendar(1) has been useless for too long now.
Regards,
Johan Veenhuizen
Index: calendar.c
===================================================================
RCS file: /cvsroot/src/usr.bin/calendar/calendar.c,v
retrieving revision 1.36.2.1
diff -u -r1.36.2.1 calendar.c
--- calendar.c 19 Jul 2005 21:44:58 -0000 1.36.2.1
+++ calendar.c 2 May 2006 10:43:34 -0000
@@ -276,13 +276,14 @@
}
}
- if (flags & (F_WILDMONTH|F_WILDDAY))
+ if ((flags & F_WILDMONTH) && (flags & F_WILDDAY))
return (1);
- if ((flags & (F_WILDMONTH|F_ISDAY)) && (day == tp->tm_mday))
+ if ((flags & F_WILDMONTH) && (flags & F_ISDAY) && (day == tp->tm_mday))
return (1);
- if ((flags & (F_ISMONTH|F_WILDDAY)) && (month == tp->tm_mon + 1))
+ if ((flags & F_ISMONTH) && (flags & F_WILDDAY) &&
+ (month == tp->tm_mon + 1))
return (1);
if (flags & F_ISDAY)