summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-03-13 23:33:04 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-03-13 23:33:04 +0000
commit63f2c1e106a2635d888c6b582f4c59b5c0ecc7ee (patch)
tree8f937b14482c666265f81797ebd4f122c8260cfb
parent79a0689e17f959bdb246dc37bbbbfeba4c2b3b56 (diff)
downloadperl-63f2c1e106a2635d888c6b582f4c59b5c0ecc7ee.tar.gz
perl 3.0 patch #15 (combined patch)
In patch 13, there was a fix to make the VAR=value construct in a command force interpretation by the shell. This was botched, causing an argv list to be occasionally allocated with too small a size. This problem is hidden on some machines because of BSD malloc's semantics. The lib/dumpvar.pl file was missing final 1; which made it difficult to tell if it loaded right. The lib/termcap.pl Tgetent subroutine didn't interpret ^x right due to a missing ord(). In the section of the man page that gives hints for C programmers, it falsely declared that you can't subscript array values. As of patch 13, this statement is "inoperative". The t/op.sleep test assumed that a sleep of 2 seconds would always return a value of 2 seconds slept. Depending on the load and the whimsey of the scheduler, it could actually sleep longer than 2 seconds upon occasion. It now allows sleeps of up to 10 seconds.
-rw-r--r--doio.c11
-rw-r--r--lib/dumpvar.pl2
-rw-r--r--lib/termcap.pl4
-rw-r--r--patchlevel.h2
-rw-r--r--perl.man.47
-rw-r--r--t/op.sleep4
6 files changed, 18 insertions, 12 deletions
diff --git a/doio.c b/doio.c
index ea9a71f347..e19a6f2591 100644
--- a/doio.c
+++ b/doio.c
@@ -1,4 +1,4 @@
-/* $Header: doio.c,v 3.0.1.6 90/03/12 16:30:07 lwall Locked $
+/* $Header: doio.c,v 3.0.1.7 90/03/14 12:26:24 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,9 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: doio.c,v $
+ * Revision 3.0.1.7 90/03/14 12:26:24 lwall
+ * patch15: commands involving execs could cause malloc arena corruption
+ *
* Revision 3.0.1.6 90/03/12 16:30:07 lwall
* patch13: system 'FOO=bar command' didn't invoke sh as it should
*
@@ -931,6 +934,9 @@ char *cmd;
/* see if there are shell metacharacters in it */
+ for (s = cmd; *s && isalpha(*s); s++) ; /* catch VAR=val gizmo */
+ if (*s == '=')
+ goto doshell;
for (s = cmd; *s; s++) {
if (*s != ' ' && !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) {
if (*s == '\n' && !s[1]) {
@@ -942,9 +948,6 @@ char *cmd;
return FALSE;
}
}
- for (s = cmd; *s && isalpha(*s); s++) ; /* catch VAR=val gizmo */
- if (*s == '=')
- goto doshell;
New(402,argv, (s - cmd) / 2 + 2, char*);
a = argv;
diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl
index 8a49ec09e7..b8cff8952c 100644
--- a/lib/dumpvar.pl
+++ b/lib/dumpvar.pl
@@ -26,3 +26,5 @@ sub main'dumpvar {
}
}
}
+
+1;
diff --git a/lib/termcap.pl b/lib/termcap.pl
index a92b71456c..35b5ec0655 100644
--- a/lib/termcap.pl
+++ b/lib/termcap.pl
@@ -1,4 +1,4 @@
-;# $Header: termcap.pl,v 3.0.1.1 90/02/28 17:46:44 lwall Locked $
+;# $Header: termcap.pl,v 3.0.1.2 90/03/14 12:28:28 lwall Locked $
;#
;# Usage:
;# do 'ioctl.pl';
@@ -70,7 +70,7 @@ sub Tgetent {
s/\\f/\f/g;
s/\\\^/\377/g;
s/\^\?/\177/g;
- s/\^(.)/pack('c',$1 & 31)/eg;
+ s/\^(.)/pack('c',ord($1) & 31)/eg;
s/\\(.)/$1/g;
s/\377/^/g;
$TC{$entry} = $_ if $TC{$entry} eq '';
diff --git a/patchlevel.h b/patchlevel.h
index f95be0eb07..69d9c2fd72 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -1 +1 @@
-#define PATCHLEVEL 14
+#define PATCHLEVEL 15
diff --git a/perl.man.4 b/perl.man.4
index 0fd5983c4b..4269559b90 100644
--- a/perl.man.4
+++ b/perl.man.4
@@ -1,7 +1,10 @@
''' Beginning of part 4
-''' $Header: perl.man.4,v 3.0.1.6 90/03/12 16:54:04 lwall Locked $
+''' $Header: perl.man.4,v 3.0.1.7 90/03/14 12:29:50 lwall Locked $
'''
''' $Log: perl.man.4,v $
+''' Revision 3.0.1.7 90/03/14 12:29:50 lwall
+''' patch15: man page falsely states that you can't subscript array values
+'''
''' Revision 3.0.1.6 90/03/12 16:54:04 lwall
''' patch13: improved documentation of *name
'''
@@ -1458,8 +1461,6 @@ ARGV must be capitalized.
The \*(L"system\*(R" calls link, unlink, rename, etc. return nonzero for success, not 0.
.Ip * 4 2
Signal handlers deal with signal names, not numbers.
-.Ip * 4 2
-You can't subscript array values, only arrays (no $x = (1,2,3)[2];).
.PP
Seasoned
.I sed
diff --git a/t/op.sleep b/t/op.sleep
index 28d034ca76..99933006b9 100644
--- a/t/op.sleep
+++ b/t/op.sleep
@@ -1,8 +1,8 @@
#!./perl
-# $Header: op.sleep,v 3.0 89/10/18 15:31:15 lwall Locked $
+# $Header: op.sleep,v 3.0.1.1 90/03/14 12:31:39 lwall Locked $
print "1..1\n";
$x = sleep 2;
-if ($x == 2) {print "ok 1\n";} else {print "not ok 1\n";}
+if ($x >= 2 && $x <= 10) {print "ok 1\n";} else {print "not ok 1 $x\n";}