summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1999-05-14 18:29:49 (GMT)
committerstanton <stanton>1999-05-14 18:29:49 (GMT)
commit489a58b5fc11bc30a2f91ed570afc77917e9b1c0 (patch)
tree0744c75a4ad2d6ca5c131fb08410c2a2ac637119
parent8caafaac857b941a7f516eb457c9115cc870064e (diff)
downloadtcl-489a58b5fc11bc30a2f91ed570afc77917e9b1c0.zip
tcl-489a58b5fc11bc30a2f91ed570afc77917e9b1c0.tar.gz
tcl-489a58b5fc11bc30a2f91ed570afc77917e9b1c0.tar.bz2
merged 1-3-b2 changes into mainline
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclDate.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3003888..c2ffe14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-05-14 <redman@scriptics.com>
+
+ * generic/tclDate.c: Applied patch to fix 100-year and 400-year
+ boundaries in leap year code, from Isaac Hollander. [Bug: 2066]
+
1999-05-13 <stanton@scriptics.com>
* unix/Makefile.in:
diff --git a/generic/tclDate.c b/generic/tclDate.c
index cdbcfe8..3544737 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDate.c,v 1.4 1999/04/16 00:46:45 stanton Exp $
+ * RCS: @(#) $Id: tclDate.c,v 1.5 1999/05/14 18:29:50 stanton Exp $
*/
#include "tclInt.h"
@@ -430,10 +430,12 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr)
Julian += DaysInMonth[i];
if (Year >= EPOCH) {
for (i = EPOCH; i < Year; i++)
- Julian += 365 + (i % 4 == 0);
+ Julian += 365 + (((i % 4) == 0) &&
+ (((i % 100) != 0) || ((i % 400) == 0)));
} else {
for (i = Year; i < EPOCH; i++)
- Julian -= 365 + (i % 4 == 0);
+ Julian -= 365 + (((i % 4) == 0) &&
+ (((i % 100) != 0) || ((i % 400) == 0)));
}
Julian *= SECSPERDAY;
Julian += TclDateTimezone * 60L;