From owner-freebsd-bugs Fri May 26 16:20:05 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA05045 for bugs-outgoing; Fri, 26 May 1995 16:20:05 -0700 Received: (from gnats@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA05038 ; Fri, 26 May 1995 16:20:03 -0700 Date: Fri, 26 May 1995 16:20:03 -0700 Message-Id: <199505262320.QAA05038@freefall.cdrom.com> From: Bill Fenner Reply-To: Bill Fenner To: freebsd-bugs Subject: gnu/449: perl's $] variable is broken In-Reply-To: Your message of Fri, 26 May 1995 16:12:10 PDT <199505262312.QAA04792@fenestro.parc.xerox.com> Sender: bugs-owner@FreeBSD.org Precedence: bulk >Number: 449 >Category: gnu >Synopsis: perl's $] variable is broken >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 26 16:20:02 1995 >Originator: Bill Fenner >Organization: Xerox PARC >Release: FreeBSD 2.1.0-Development i386 >Environment: FreeBSD-2.0 SNAP-950412 >Description: Perl's $] variable returns "4", not "4.036": % perl print $] + 0; 4% On a Sun: crevenia% perl print $] + 0; 4.0359999999999995879crevenia% This also appears to (from reading the code) break the auto running of taintperl and suidperl. >How-To-Repeat: print the perl $] value in a numerical context. >Fix: Believe it or not, the fix is to put the rcsid back. Given the existing rcsid of $RCSfile: perl.c,v $$Revision: 1.2 $$Date: 1994/10/27 23:16:54 $ the "patchlevel" variable gets set to "4/136", which atof() returns 4.0 for. The Revision needs to be 4.0 to get the proper behavior. (see usr/src/gnu/usr.sbin/perl/perl/perl.c, line 128: sprintf(patchlevel,"%3.3s%2.2d", index(rcsid,'4'), PATCHLEVEL); Of course, another fix would simply be to change this to sprintf(patchlevel,"%3.3s%2.2d", "4.0", PATCHLEVEL); since it's pretty ill to use the rcsid in this manner... >Audit-Trail: >Unformatted: