From cse.psu.edu!owner-9fans Wed Sep 11 23:35:10 1996
Received: from cse.psu.edu ([130.203.3.50]) by cannon.ecf.toronto.edu with SMTP id <2131>; Wed, 11 Sep 1996 23:33:10 -0400
Received: from localhost (majordom@localhost) by cse.psu.edu (8.7.5/8.7.3) with SMTP id XAA14098; Wed, 11 Sep 1996 23:32:08 -0400 (EDT)
Received: by claven.cse.psu.edu (bulk_mailer v1.5); Wed, 11 Sep 1996 23:30:57 -0400
Received: (from majordom@localhost) by cse.psu.edu (8.7.5/8.7.3) id XAA14043 for 9fans-outgoing; Wed, 11 Sep 1996 23:30:36 -0400 (EDT)
X-Authentication-Warning: claven.cse.psu.edu: majordom set sender to owner-9fans using -f
Received: from ns.research.att.com (ns.research.att.com [192.20.225.4]) by cse.psu.edu (8.7.5/8.7.3) with SMTP id XAA14039 for <9fans@cse.psu.edu>; Wed, 11 Sep 1996 23:30:20 -0400 (EDT)
Received: from research.research.att.com by ns; Wed Sep 11 23:29:06 EDT 1996
Received: from corona.research.att.com by research; Wed Sep 11 23:27:57 EDT 1996
Received: (from rsc@localhost) by corona.research.att.com (8.7.5/8.7) id XAA21627 for 9fans@cse.psu.edu; Wed, 11 Sep 1996 23:30:10 -0400 (EDT)
Date:	Wed, 11 Sep 1996 23:30:10 -0400
Message-Id: <199609120330.XAA21627@corona.research.att.com>
From:	Russ Cox <rsc@research.att.com>
To:	9fans@cse.psu.edu
Subject: bug in calendar(1) on saturday.
Sender: owner-9fans@cse.psu.edu
Reply-To: 9fans@cse.psu.edu
Precedence: bulk
Status: R

The /sys/src/cmd/calendar.c shipped on the CD behaves as
follows.  During the week (Sunday-Thursday) it prints today's
events and tomorrow's.  On Friday, it prints events for
Friday, Saturday, and Sunday, and Monday.  On Saturday, however,
it prints events for Saturday, Sunday, and Tuesday.  This does
not agree with the man page.

A fix (pseudo-diff):

	tm = localtime(now+24*60*60);
	dates(&last, tm);
        if(tm->wday == 6){
                tm = localtime(now+2*24*60*60);
                dates(&last, tm);
        }
        if(tm->wday == 0){
                tm = localtime(now+3*24*60*60);
                dates(&last, tm);
        }

becomes

	tm = localtime(now+=24*60*60);
	dates(&last, tm);
	if(tm->wday == 6){
		tm = localtime(now+=24*60*60);
		dates(&last, tm);
	}
	if(tm->wday == 0){
		tm = localtime(now+=24*60*60);
		dates(&last, tm);
	}

Russ

