Date: Fri, 15 Jan 1999 16:23:17 +1100 From: Peter Jeremy <peter.jeremy@auss2.alcatel.com.au> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/9501: Several cvs contrib files are not Y2K compliant Message-ID: <99Jan15.162238est.40324@border.alcanet.com.au>
next in thread | raw e-mail | index | archive | help
>Number: 9501 >Category: bin >Synopsis: Several cvs contrib files are not Y2K compliant >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 14 21:30:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Peter Jeremy >Release: FreeBSD 3.0-CURRENT i386 >Organization: Alcatel Australia >Environment: >Description: 1) The log.pl and sccs2rcs.csh scripts prepend `19' to the year resulting in a display 19100 for 2000. 2) The log_accum.pl script uses a two digit year in one place and in another place assumes that the tm_year is year within century rather than years since 1900. >How-To-Repeat: Code inspection >Fix: --- /3.0/src/contrib/cvs/contrib/log.pl Fri May 16 08:46:07 1997 +++ ./log.pl Fri Jan 15 14:46:37 1999 @@ -91,6 +91,7 @@ @days = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; +$year += 1900; # get a login name for the guy doing the commit.... # @@ -111,12 +112,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"; } --- /3.0/src/contrib/cvs/contrib/log_accum.pl Fri May 16 08:46:07 1997 +++ ./log_accum.pl Fri Jan 15 14:50:50 1999 @@ -172,12 +172,14 @@ sub build_header { local($header); local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); - $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%02d/%02d/%02d %02d:%02d:%02d", + if ($year >= 100) + $year += 1900; + $header = sprintf("CVSROOT:\t%s\nModule name:\t%s\nRepository:\t%s\nChanges by:\t%s@%s\t%04d/%02d/%02d %02d:%02d:%02d", $cvsroot, $modulename, $dir, $login, $hostdomain, - $year%100, $mon+1, $mday, + $year, $mon+1, $mday, $hour, $min, $sec); } @@ -210,7 +212,7 @@ ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $zone, $gmtoff) = ($TZ eq 'GMT') ? gmtime(time) : localtime(time); - $year += ($year < 70) ? 2000 : 1900; + $year += 1900; if ($gmtoff != 0) { $tzoff = sprintf("%05d", ($gmtoff / 60) * 100); --- /3.0/src/contrib/cvs/contrib/sccs2rcs.csh Fri May 16 08:46:09 1997 +++ ./sccs2rcs.csh Fri Jan 15 14:46:37 1999 @@ -177,7 +177,7 @@ if ($status != 0) goto ERROR # get file into current dir and get stats - set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("19%s %s", $3, $4); exit}'` + set date = `sccs prs -r$rev $file | grep "^D " | awk '{printf("%d %s", ($3 < 1900) ? $3 + 1900 : $3, $4); exit}'` set author = `sccs prs -r$rev $file | grep "^D " | awk '{print $5; exit}'` echo "" echo "==> file $file, rev=$rev, date=$date, author=$author" >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Jan15.162238est.40324>