Bug 15182

Summary: "* Wed-1 event" in calendar produces "31 Nov* event" in mail
Product: Base System Reporter: Julian H. Stacey Jhs Jhs <jhs>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description Julian H. Stacey Jhs@jhs.muc.de Jhs 1999-11-30 10:30:02 UTC
	.calendar/calendar containing just 1 line:
		* Wed-1 MECC, Last Wednesday In Month
	calendar outputs
		Nov 31* MECC, Last Wednesday In Month

Fix: 

I looked at 3.3/src/usr.bin/calendar/day.c:
	 int daytab[][14] = {
         { 0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364 },
         { 0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
	 };
	that 333 seems correct, so a fix is not as trivial as I hoped !
How-To-Repeat: 
	Put in your ~/.calendar
		* Wed-1 There is no 31 Nov 1999, Wednesday is 1st December
	wind the clock back to 30 Nov 1999, run calendar.
	& get the same impossible date I did !
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-06-16 16:27:06 UTC
State Changed
From-To: open->closed

Fixed in rev 1.12 of day.c.