bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Y2K bug in CVS 1.11


From: Oleg Goldshmidt
Subject: Y2K bug in CVS 1.11
Date: 10 Sep 2001 13:56:21 +0300
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Cuyahoga Valley)

I just noticed the following Y2K effect in

RH7.1 Linux 2.4.2-2 on i686 with cvs-1.11-3 and perl-5.6.0-12
 
In my loginfo file I have 

DEFAULT         $CVSROOT/CVSROOT/log -f $CVSROOT/CVSROOT/commitlog -m oleg %s

that sends me an email upon each commit to the repository.

I just noticed that the emails start with

Date:   Sunday September 9, 19101 @ 17:57

Searching the bug archives on www.cvshome.org showed nothing, though
maybe my search was not perfect.

I didn't try to find out whether the bug is in CVSROOT/log or in
perl's localtime. Instead, I did a crude fix by patching the
CVSROOT/log script as follows:

--- log.old     Mon Sep 10 13:42:28 2001
+++ log.new     Mon Sep 10 13:41:29 2001
@@ -94,6 +94,10 @@
 
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
 
+# We live in the 21st century already
+$year -= 100;
+$year += 2000;
+
 # get a login name for the guy doing the commit....
 #
 $login = getlogin || (getpwuid($<))[0] || "nobody";
@@ -113,12 +117,12 @@
 # 
 print OUT "\n";
 print OUT "****************************************\n";
-print OUT "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . 
sprintf("%02d", $min) . "\n";
+print OUT "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . 
sprintf("%02d", $min) . "\n";
 print OUT "Author:\t$login\n\n";
 
 if (MAIL) {
        print MAIL "\n";
-       print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, 19$year @ $hour:" . 
sprintf("%02d", $min) . "\n";
+       print MAIL "Date:\t$days[$wday] $mos[$mon] $mday, $year @ $hour:" . 
sprintf("%02d", $min) . "\n";
        print MAIL "Author:\t$login\n\n";
 }
 
Hope it helps,

-- 
Oleg Goldshmidt | ogoldshmidt@NOSPAM.computer.org 
"If it ain't broken, it has not got enough features yet."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]