From wbe@psr.com  Thu Jun  7 03:38:06 2012
Return-Path: <wbe@psr.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E32F106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Jun 2012 03:38:06 +0000 (UTC)
	(envelope-from wbe@psr.com)
Received: from smtp1.sccoast.net (smtp1.sccoast.net [66.153.203.168])
	by mx1.freebsd.org (Postfix) with ESMTP id 323CE8FC24
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Jun 2012 03:38:06 +0000 (UTC)
Received: from mail.psr.com ([67.212.42.216]:21411 helo=psr.com)
	by smtp1.sccoast.net with esmtp (Exim 4.76)
	(envelope-from <wbe@psr.com>)
	id 1ScTXx-0003pP-CD
	for FreeBSD-gnats-submit@freebsd.org; Wed, 06 Jun 2012 23:38:05 -0400
Received: (from wbe@localhost)
	by psr.com (8.14.5/8.14.5/Submit) id q573btHP010221;
	Wed, 6 Jun 2012 23:37:55 -0400 (EDT)
	(envelope-from wbe)
Message-Id: <201206070337.q573btHP010221@psr.com>
Date: Wed, 6 Jun 2012 23:37:55 -0400 (EDT)
From: Winston <wbe@psr.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /usr/bin/calendar does not match "Thu+1" or "Mon+1" in some months
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         168785
>Category:       bin
>Synopsis:       calendar(1): /usr/bin/calendar does not match "Thu+1" or "Mon+1" in some months [regression]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 07 03:40:05 UTC 2012
>Closed-Date:    
>Last-Modified:  Thu Apr 17 04:40:06 UTC 2014
>Originator:     Winston
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD crystal 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

>Description:

Calendar file dates such as "Thu+1" and "Mon+1" are failing to match in two
cases: (1) the 7th of Jan-Nov, and (2) December.  However, there was
another failure that wasn't either of those cases.  I haven't tested other
days of the week or +2, +3, etc.

I chose medium priority because this probably affects a fair number of people.

>How-To-Repeat:

DETAILS/EXAMPLES:

[The bug occurs whether or not the command line options below are used.
 I first noticed it today (a Wednesday) because a Thu+1 event tomorrow was
 not in calendar's output.]

EXAMPLE 1: Thu+1

~/.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.2011 -W 9
&end
Jan  6* foo
Feb  3* foo
Mar  3* foo
	<----- Apr 7 absent
May  5* foo
Jun  2* foo
	<----- Jul 7 absent
Aug  4* foo
Sep  1* foo
Oct  6* foo
Nov  3* foo
	<----- Dec 1 absent

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

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

EXAMPLE 2: Mon+1

foo:
Mon+1	foo		("Mon+1\tfoo\n")

foreach i ( 1 2 3 4 5 6 7 8 9 10 11 12 )
&calendar -t 1.$i.2011 -W 9 -f foo
&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

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

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

HTH,
 -WBE
>Fix:
(none provided in this message)

>Release-Note:
>Audit-Trail:

From: Jaakko Heinonen <jh@FreeBSD.org>
To: bug-followup@FreeBSD.org, wbe@psr.com, edwin@FreeBSD.org
Cc:  
Subject: Re: bin/168785: /usr/bin/calendar does not match "Thu+1" or "Mon+1"
 in some months
Date: Fri, 23 Nov 2012 12:05:03 +0200

 Hi,
 
 This seems to be yet another regression in r205821. r205820 seems to
 work correctly.
 
 edwin: Please take a look at this.
 
 -- 
 Jaakko
>Unformatted:
