summaryrefslogtreecommitdiff
path: root/ext/PerlIO/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-09-30 15:12:29 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-09-30 15:12:29 +0000
commit47cc46ee1b0f541fba01adac0a6a3dd526924313 (patch)
treeab23eb3088fbba3914a222ca7c9e93cd7b6da55b /ext/PerlIO/t
parent3afc138ae8d937f9bbca45350859ec2c8429f730 (diff)
downloadperl-47cc46ee1b0f541fba01adac0a6a3dd526924313.tar.gz
A fix for [perl #31692] : as PerlIO::scalar accesses directly the
PV of the scalar it reads from, avoid to read it when it's an undefined PV. p4raw-id: //depot/perl@23340
Diffstat (limited to 'ext/PerlIO/t')
-rw-r--r--ext/PerlIO/t/scalar.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/PerlIO/t/scalar.t b/ext/PerlIO/t/scalar.t
index 4021d431a2..818aab575f 100644
--- a/ext/PerlIO/t/scalar.t
+++ b/ext/PerlIO/t/scalar.t
@@ -15,7 +15,7 @@ BEGIN {
}
$| = 1;
-print "1..25\n";
+print "1..26\n";
my $fh;
my $var = "ok 2\n";
@@ -143,3 +143,9 @@ print <$fh>;
close $fh;
print $ok ? "ok 25\n" : "not ok 25\n";
}
+
+my $data = "a non-empty PV";
+$data = undef;
+open(MEM, '<', \$data) or die "Fail: $!\n";
+my $x = join '', <MEM>;
+print $x eq '' ? "ok 26\n" : "not ok 26\n";