summaryrefslogtreecommitdiff
path: root/ext/PerlIO/Via/Via.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-07-01 18:25:22 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-07-01 18:25:22 +0000
commit52f3c1af8670f243c94919af003c622c61f1ce6f (patch)
treeb098c064a7a9a8ab5c142d4333fbf7d57a2f0b8c /ext/PerlIO/Via/Via.xs
parent1acdb0da20c8b57ef4b35c7c1b7e0ed3fc417368 (diff)
downloadperl-52f3c1af8670f243c94919af003c622c61f1ce6f.tar.gz
Allow PerlIO::Via to look for modules in the default
namespace PerlIO::Via::. p4raw-id: //depot/perl@17393
Diffstat (limited to 'ext/PerlIO/Via/Via.xs')
-rw-r--r--ext/PerlIO/Via/Via.xs6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/PerlIO/Via/Via.xs b/ext/PerlIO/Via/Via.xs
index 04c4d48906..0917a36d65 100644
--- a/ext/PerlIO/Via/Via.xs
+++ b/ext/PerlIO/Via/Via.xs
@@ -142,6 +142,12 @@ PerlIOVia_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
char *pkg = SvPV(arg,pkglen);
s->obj = SvREFCNT_inc(arg);
s->stash = gv_stashpvn(pkg, pkglen, FALSE);
+ if (!s->stash)
+ {
+ s->obj = newSVpvn(Perl_form(aTHX_ "PerlIO::Via::%s",pkg), pkglen + 13);
+ SvREFCNT_dec(arg);
+ s->stash = gv_stashpvn(SvPVX(s->obj), pkglen + 13, FALSE);
+ }
if (s->stash)
{
SV *modesv = (mode) ? sv_2mortal(newSVpvn(mode,strlen(mode))) : Nullsv;