From: Russ Cox rsc@research.att.com
Subject: bug in calendar(1) on saturday.
Date: Wed, 11 Sep 1996 23:30:10 -0400 [thread overview]
Message-ID: <19960912033010.UhOG2DHvJcdaSWGix0t-dEGbKj0TKQo6LyztYQOmXSU@z> (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
reply other threads:[~1996-09-12 3:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19960912033010.UhOG2DHvJcdaSWGix0t-dEGbKj0TKQo6LyztYQOmXSU@z \
--to=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).