9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* bug in calendar(1) on saturday.
@ 1996-09-12  3:30 Russ
  0 siblings, 0 replies; only message in thread
From: Russ @ 1996-09-12  3:30 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-09-12  3:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-12  3:30 bug in calendar(1) on saturday Russ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).