Change 12549 by gsar@moonru on 2001/10/21 18:03:19
readline() doesn't work with our variables; it confuses them with
my variables (change#4227 was incomplete)
Affected files ...
... //depot/maint-5.6/perl/t/base/rs.t#3 edit
... //depot/maint-5.6/perl/toke.c#64 edit
Differences ...
==== //depot/maint-5.6/perl/t/base/rs.t#3 (xtext) ====
Index: perl/t/base/rs.t
--- perl/t/base/rs.t.~1~ Sun Oct 21 12:15:05 2001
+++ perl/t/base/rs.t Sun Oct 21 12:15:05 2001
@@ -1,7 +1,7 @@
#!./perl
# Test $!
-print "1..14\n";
+print "1..16\n";
$teststring = "1\n12\n123\n1234\n1234\n12345\n\n123456\n1234567\n";
@@ -86,9 +86,7 @@
$bar = <TESTFILE>;
if ($bar eq "78") {print "ok 10\n";} else {print "not ok 10\n";}
-# Get rid of the temp file
close TESTFILE;
-unlink "./foo";
# Now for the tricky bit--full record reading
if ($^O eq 'VMS') {
@@ -130,3 +128,35 @@
# put their own tests in) so we just punt
foreach $test (11..14) {print "ok $test # skipped on non-VMS system\n"};
}
+
+$/ = "\n";
+
+# see if open/readline/close work on our and my variables
+{
+ if (open our $T, "./foo") {
+ my $line = <$T>;
+ print "# $line\n";
+ length($line) == 40 or print "not ";
+ close $T or print "not ";
+ }
+ else {
+ print "not ";
+ }
+ print "ok 15\n";
+}
+
+{
+ if (open my $T, "./foo") {
+ my $line = <$T>;
+ print "# $line\n";
+ length($line) == 40 or print "not ";
+ close $T or print "not ";
+ }
+ else {
+ print "not ";
+ }
+ print "ok 16\n";
+}
+
+# Get rid of the temp file
+END { unlink "./foo"; }
==== //depot/maint-5.6/perl/toke.c#64 (text) ====
Index: perl/toke.c
--- perl/toke.c.~1~ Sun Oct 21 12:15:05 2001
+++ perl/toke.c Sun Oct 21 12:15:05 2001
@@ -6568,7 +6568,9 @@
/* try to find it in the pad for this block, otherwise find
add symbol table ops
*/
- if ((tmp = pad_findmy(d)) != NOT_IN_PAD) {
+ if ((tmp = pad_findmy(d)) != NOT_IN_PAD
+ && !(SvFLAGS(AvARRAY(PL_comppad_name)[tmp]) & SVpad_OUR))
+ {
OP *o = newOP(OP_PADSV, 0);
o->op_targ = tmp;
PL_lex_op = (OP*)newUNOP(OP_READLINE, 0, o);
End of Patch.