Change 18023 by [EMAIL PROTECTED] on 2002/10/17 12:56:28
Subject: Re: [perl #17830] open FH, "<&", $fd
From: Steve Grazzini <[EMAIL PROTECTED]>
Date: 11 Oct 2002 22:28:58 -0000
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/doio.c#209 edit
.... //depot/perl/t/io/open.t#31 edit
Differences ...
==== //depot/perl/doio.c#209 (text) ====
Index: perl/doio.c
--- perl/doio.c#208~17954~ Wed Oct 2 06:18:01 2002
+++ perl/doio.c Thu Oct 17 05:56:28 2002
@@ -325,6 +325,7 @@
}
if (num_svs && (SvIOK(*svp) || (SvPOK(*svp) &&
looks_like_number(*svp)))) {
fd = SvUV(*svp);
+ num_svs = 0;
}
else if (isDIGIT(*type)) {
/*SUPPRESS 530*/
==== //depot/perl/t/io/open.t#31 (xtext) ====
Index: perl/t/io/open.t
--- perl/t/io/open.t#30~16257~ Sun Apr 28 13:26:30 2002
+++ perl/t/io/open.t Thu Oct 17 05:56:28 2002
@@ -12,7 +12,7 @@
$Is_VMS = $^O eq 'VMS';
$Is_MacOS = $^O eq 'MacOS';
-plan tests => 94;
+plan tests => 95;
my $Perl = which_perl();
@@ -210,14 +210,14 @@
{
local *F;
for (1..2) {
- ok( open(F, qq{$Perl -le "print 'ok'"|}), 'open to pipe' );
+ ok( open(F, qq{$Perl -le "print 'ok'"|}), 'open to pipe' );
is(scalar <F>, "ok\n", ' readline');
- ok( close F, ' close' );
+ ok( close F, ' close' );
}
for (1..2) {
- ok( open(F, "-|", qq{$Perl -le "print 'ok'"}), 'open -|');
- is( scalar <F>, "ok\n", ' readline');
+ ok( open(F, "-|", qq{$Perl -le "print 'ok'"}), 'open -|');
+ is( scalar <F>, "ok\n", ' readline');
ok( close F, ' close' );
}
}
@@ -225,8 +225,11 @@
# other dupping techniques
{
- ok( open(my $stdout, ">&", \*STDOUT), 'dup \*STDOUT into lexical fh');
- ok( open(STDOUT, ">&", $stdout), 'restore dupped STDOUT from lexical fh');
+ ok( open(my $stdout, ">&", \*STDOUT), 'dup \*STDOUT into lexical fh');
+ ok( open(STDOUT, ">&", $stdout), 'restore dupped STDOUT from lexical
+fh');
+
+ # used to try to open a file [perl #17830]
+ ok( open(my $stdin, "<&", fileno STDIN), 'dup fileno(STDIN) into lexical fh');
}
SKIP: {
End of Patch.