ports/64871: Leap year calculation is broken in cvstrac.
Johannes Groedem
johs at copyleft.no
Sun Mar 28 22:40:09 UTC 2004
>Number: 64871
>Category: ports
>Synopsis: Leap year calculation is broken in cvstrac.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Mar 28 14:40:08 PST 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list