Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/gnu/usr.bin/tar Pull up revision 1.5 (requested by tron):
details: https://anonhg.NetBSD.org/src/rev/422695d1b507
branches: netbsd-1-4
changeset: 469997:422695d1b507
user: he <he%NetBSD.org@localhost>
date: Sat Jan 08 18:45:39 2000 +0000
description:
Pull up revision 1.5 (requested by tron):
Fix Y2K bug in date parser, fixing PR#9123.
diffstat:
gnu/usr.bin/tar/getdate.y | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r c9d8453cec9b -r 422695d1b507 gnu/usr.bin/tar/getdate.y
--- a/gnu/usr.bin/tar/getdate.y Sat Jan 08 18:43:28 2000 +0000
+++ b/gnu/usr.bin/tar/getdate.y Sat Jan 08 18:45:39 2000 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: getdate.y,v 1.4 1998/01/05 04:54:16 perry Exp $
+/* $NetBSD: getdate.y,v 1.4.2.1 2000/01/08 18:45:39 he Exp $
**
** Originally written by Steven M. Bellovin <smb%research.att.com@localhost> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
@@ -98,7 +98,7 @@
#if !defined(lint) && !defined(SABER)
static char RCS[] =
- "$NetBSD: getdate.y,v 1.4 1998/01/05 04:54:16 perry Exp $";
+ "$NetBSD: getdate.y,v 1.4.2.1 2000/01/08 18:45:39 he Exp $";
#endif /* !defined(lint) && !defined(SABER) */
@@ -612,11 +612,14 @@
if (Year < 0)
Year = -Year;
- if (Year < 100)
+ if (Year < 100) {
Year += 1900;
+ if (Year < EPOCH)
+ Year += 100;
+ }
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
? 29 : 28;
- if (Year < EPOCH || Year > 1999
+ if (Year < EPOCH || Year > 9999
|| Month < 1 || Month > 12
/* Lint fluff: "conversion from long may lose accuracy" */
|| Day < 1 || Day > DaysInMonth[(int)--Month])
Home |
Main Index |
Thread Index |
Old Index