Article View: net.bugs.v7
Article #109Bug in calendar(1)
From: utzoodecvaxharpoeaglemhuxtmhuxam...
Date: Tue, 11 Jan 1983 19:17
Date: Tue, 11 Jan 1983 19:17
31 lines
1395 bytes
1395 bytes
One of the users on my 4.1 BSD machine has been complaining that his
calendar hasn't been working since the 1st of the year, and after a bit
of head scratching and a cup of coffee, I discovered that calendar
doesn't care for a specification like `01/01 Happy New Year! (hic)' due
to the leading `0' in the month.
So, I patched /usr/src/cmd/calendar/calendar.c thusly:
*** /usr/src/cmd/calendar/calendar.c Sat Feb 28 23:49:36 1981
--- calendar.c Tue Jan 11 17:42:14 1983
***************
*** 30,36
{
struct tm *tm;
tm = localtime(&t);
! printf("(^|[ (,;])((%s[^ ]* *|%d/)0*%d)([^0123456789]|$)\n",
month[tm->tm_mon], tm->tm_mon + 1, tm->tm_mday);
printf("(^|[ (,;])((\\* *)0*%d)([^0123456789]|$)\n",
tm->tm_mday);
--- 30,36 -----
{
struct tm *tm;
tm = localtime(&t);
! printf("(^|[ (,;])((%s[^ ]* *|0*%d/)0*%d)([^0123456789]|$)\n",
month[tm->tm_mon], tm->tm_mon + 1, tm->tm_mday);
printf("(^|[ (,;])((\\* *)0*%d)([^0123456789]|$)\n",
tm->tm_mday);
***************
Marty Shannon, Jr.
BTL MH 5F-120 x3199
Technical Details
Message-ID:
<bnews.mhb5c.1037>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!eagle!mhuxt!mhuxa!mhb5c!mjs Newsgroups: net.bugs.v7,net.bugs.4bsd Title: Bug in calendar(1) Article-I.D.: mhb5c.1037 Posted: Tue Jan 11 19:17:42 1983 Received: Thu Jan 13 03:54:13 1983 Subject: Bug in calendar(1) Date: Tue, 11 Jan 1983 19:17:42 +0000 Message-ID: <bnews.mhb5c.1037>