Subject: regress for usr.bin/calendar?
To: None <current-users@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: current-users
Date: 07/19/2005 16:34:39
Can someone please check the following?

diff -b -u -r1.37 calendar.c
--- usr.bin/calendar/calendar.c	2 Jun 2005 01:39:24 -0000	1.37
+++ usr.bin/calendar/calendar.c	15 Jul 2005 05:02:31 -0000
@@ -256,7 +256,8 @@
   	if (flags & F_ISDAY || v1 > 12) {
   		/* found a day */
   		day = v1;
-		month = tp->tm_mon + 1;
+		v2 = getfield(endp, &endp, &flags);
+		month = v2;
   	} else if (flags & F_ISMONTH) {
   		month = v1;
   		/* if no recognizable day, assume the first */


(By the way, why fall back to day 1?)

Also, are there any docs on adding a regress testing?

If not, I will add src/regress/usr.bin/calendar/Makefile and a testing 
calendar file and the output from running calendar -f with that test file 
for some given dates (-d).

And maybe also add output files for using -l and -w also. Maybe also 
calendar will need to be built with custom _PATH_CALENDARS for testing. I 
see an example at src/regress/bin/df/Makefile for building a testing 
version.

  Jeremy C. Reed

  	  	 	 BSD News, BSD tutorials, BSD links
 	  	 	 http://www.bsdnewsletter.com/