From johs@justice.copyleft.no  Sun Mar 28 14:30:53 2004
Return-Path: <johs@justice.copyleft.no>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 81C5B16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Mar 2004 14:30:53 -0800 (PST)
Received: from justice.copyleft.no (justice.copyleft.no [212.71.72.22])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B0F8A43D2F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Mar 2004 14:30:52 -0800 (PST)
	(envelope-from johs@justice.copyleft.no)
Received: (from johs@localhost)
	by justice.copyleft.no (8.11.6/8.11.6) id i2SMUod07899;
	Mon, 29 Mar 2004 00:30:50 +0200 (CEST)
	(envelope-from johs)
Message-Id: <200403282230.i2SMUod07899@justice.copyleft.no>
Date: Mon, 29 Mar 2004 00:30:50 +0200 (CEST)
From: Johannes Groedem <johs@copyleft.no>
Reply-To: Johannes Groedem <johs@copyleft.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Leap year calculation is broken in cvstrac.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         64871
>Category:       ports
>Synopsis:       Leap year calculation is broken in devel/cvstrac.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 28 14:40:08 PST 2004
>Closed-Date:    Wed Jun 16 07:36:34 GMT 2004
>Last-Modified:  Wed Jun 16 07:36:34 GMT 2004
>Originator:     Johannes Groedem
>Release:        FreeBSD 4.5-RELEASE-p5 i386
>Organization:
Copyleft Software AS
>Environment:
>Description:
	Leap year calculation is broken, so that CVS check-ins are assigned
	wrong dates in the cvstrac-web-interface.  Attached patch fixes it.
	(I've also submitted it to the cvstrac-author.)
>How-To-Repeat:
	Just do a check-in.  It will appear on cvstrac's timeline to have
	been checked in one day earlier than the actual day of the check-in.
>Fix:
	Apply patch.

--- patch-history.c begins here ---
--- history.c	5 Apr 2003 16:04:21 -0000	1.28
+++ history.c	28 Mar 2004 21:01:11 -0000
@@ -155,7 +155,7 @@
     p->tm_year += p->tm_mon/12;
     p->tm_mon %= 12;
   }
-  isLeapYr = p->tm_year/4==0 && (p->tm_year/100!=0 || (p->tm_year+300)/400==0);
+  isLeapYr = p->tm_year%4==0 && (p->tm_year%100!=0 || p->tm_year%400==0);
   p->tm_yday = priorDays[p->tm_mon] + p->tm_mday - 1;
   if( isLeapYr && p->tm_mon>1 ) p->tm_yday++;
   nDay = (p->tm_year-70)*365 + (p->tm_year-69)/4 -p->tm_year/100 + 
--- patch-history.c ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->bms 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Mar 28 21:35:05 PST 2004 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64871 
State-Changed-From-To: open->closed 
State-Changed-By: bms 
State-Changed-When: Wed Jun 16 07:36:21 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64871 
>Unformatted:
