summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-24 09:46:57 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-24 09:46:57 +0000
commit75208dda88c67964167b44f78b4c8a0a93b6aa9c (patch)
tree0cc68d676efb474c9cae294f92d21a93bbf2b250 /perlio.c
parent13cfc98d5a4a8fc07717a2057090b559b1436169 (diff)
downloadperl-75208dda88c67964167b44f78b4c8a0a93b6aa9c.tar.gz
No warning was produced if perl failed to load PerlIO::scalar
(contrary to other PerlIO layers.) p4raw-id: //depot/perl@29097
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index 46d31768d4..06a360b9b1 100644
--- a/perlio.c
+++ b/perlio.c
@@ -1431,8 +1431,14 @@ PerlIO_layer_from_ref(pTHX_ SV *sv)
/*
* For any scalar type load the handler which is bundled with perl
*/
- if (SvTYPE(sv) < SVt_PVAV)
- return PerlIO_find_layer(aTHX_ STR_WITH_LEN("scalar"), 1);
+ if (SvTYPE(sv) < SVt_PVAV) {
+ PerlIO_funcs *f = PerlIO_find_layer(aTHX_ STR_WITH_LEN("scalar"), 1);
+ /* This isn't supposed to happen, since PerlIO::scalar is core,
+ * but could happen anyway in smaller installs or with PAR */
+ if (!f && ckWARN(WARN_LAYER))
+ Perl_warner(aTHX_ packWARN(WARN_LAYER), "Unknown PerlIO layer \"scalar\"");
+ return f;
+ }
/*
* For other types allow if layer is known but don't try and load it