From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 11 Sep 1996 23:30:10 -0400 From: Russ Cox rsc@research.att.com Subject: bug in calendar(1) on saturday. Topicbox-Message-UUID: 4ca50470-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19960912033010.UhOG2DHvJcdaSWGix0t-dEGbKj0TKQo6LyztYQOmXSU@z> 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