bug in /usr/bin/calendar: "Thu+1" doesn't match on 7th or December



If you use /usr/bin/calendar with dates such as "Thu+1", beware that
they don't always work. The problem exists in FreeBSD 9.0-RELEASE, but
I wouldn't be surprised if this problem exists in earlier versions, too.

The bug: calendar does not match date expressions such as "Thu+1" or
"Mon+1" in some months. The failures mostly fall into two cases:
(1) the seventh of January - November, and
(2) December.

I have not checked other cases such as +2, +3, etc.

[I filed a bug report with details. Unfortunately, I don't have time at
the moment to download the source code and go through it.]

Here's an example:

~/.calendar/calendar:
Thu+1 foo (that's "Thu+1\tfoo\n" in C)

foreach i ( 1 2 3 4 5 6 7 8 9 10 11 12 )
&calendar -t 1.$i.2013 -W 9
&end
Jan 3* foo
<----- Feb 7 absent
<----- Mar 7 absent
Apr 4* foo
May 2* foo
Jun 6* foo
Jul 4* foo
Aug 1* foo
Sep 5* foo
Oct 3* foo
<----- Nov 7 absent
<----- Dec 5 absent

Similar results are obtained for 2011, 2012, and "Mon+1", but there may
be other cases, too, since "Mon+1" didn't match May 3, 2012.

Just thought you'd want to know since so many people use calendar,
-WBE
.



Relevant Pages

  • Re: Administrivia: Discussion - Making this list subscriber-only
    ... This includes things like 'i can't do foo anymore after ... Has someone done 'foo' with IPSEC before, ... Remember that FreeBSD is a community project; this is folks' ...
    (FreeBSD-Security)
  • Re: Why FreeBSD not popular on hardware vendors
    ... or even ``Windows lets me use FOO and do BAR. ... if "questions about various unix programs running under FreeBSD" list will be created, i will be a place for that. ...
    (freebsd-questions)
  • Re: WIP: ATA to CAM integration
    ... I don't know how FOO works, but how you're doing it is wrong ... whether FreeBSD can make use of the work or not. ... Matt has made a positive contribution to this thread. ... than quoting him out of context, how about you take a chill pill and ...
    (freebsd-current)
  • Re: WIP: ATA to CAM integration
    ... I don't know how FOO works, but how you're doing it is wrong ... whether FreeBSD can make use of the work or not. ... Matt has made a positive contribution to this thread. ... than quoting him out of context, how about you take a chill pill and ...
    (freebsd-arch)
  • Re: ports security branch
    ... > was current at the time of FreeBSD 6.0 release gets a severe vuln after ... Some admins upgrade to the latest and greatest Foo 1.2.9, ...
    (freebsd-stable)