summaryrefslogtreecommitdiff
path: root/ext/Errno
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-10-25 15:31:21 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-10-25 15:31:21 +0000
commitf8ed3476f18eeb645feeb028cc05ab8e72bae078 (patch)
tree32188bccc74719fe20898095599a1e7a8f576af9 /ext/Errno
parentc5f69108107d74addb45ef7db360779d1d1fd1a5 (diff)
downloadperl-f8ed3476f18eeb645feeb028cc05ab8e72bae078.tar.gz
Fix [perl #32130] Errno.pm must not pass references to "prototype"
p4raw-id: //depot/perl@23424
Diffstat (limited to 'ext/Errno')
-rw-r--r--ext/Errno/Errno_pm.PL3
-rwxr-xr-xext/Errno/t/Errno.t5
2 files changed, 6 insertions, 2 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index fdab9eeded..a795cfc822 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -377,7 +377,8 @@ sub FIRSTKEY {
sub EXISTS {
my ($self, $errname) = @_;
- my $proto = prototype($errname);
+ my $r = ref $errname;
+ my $proto = !$r || $r eq 'CODE' ? prototype($errname) : undef;
defined($proto) && $proto eq "";
}
diff --git a/ext/Errno/t/Errno.t b/ext/Errno/t/Errno.t
index a879cf23ce..a6b08e03f9 100755
--- a/ext/Errno/t/Errno.t
+++ b/ext/Errno/t/Errno.t
@@ -13,7 +13,7 @@ BEGIN {
use Errno;
-print "1..5\n";
+print "1..6\n";
print "not " unless @Errno::EXPORT_OK;
print "ok 1\n";
@@ -53,3 +53,6 @@ if($s1 ne $s2) {
}
print "ok 5\n";
+
+eval { exists $!{[]} };
+print $@ ? "not ok 6\n" : "ok 6\n";