summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/universal.c b/universal.c
index 2b2dd451d0..ad80a21bee 100644
--- a/universal.c
+++ b/universal.c
@@ -907,10 +907,12 @@ XS(XS_PerlIO_get_layers)
flgok = flgsvp && *flgsvp && SvIOK(*flgsvp);
if (details) {
- XPUSHs(namok ?
- newSVpv(SvPVX_const(*namsvp), 0) : &PL_sv_undef);
- XPUSHs(argok ?
- newSVpv(SvPVX_const(*argsvp), 0) : &PL_sv_undef);
+ XPUSHs(namok
+ ? newSVpvn(SvPVX_const(*namsvp), SvCUR(*namsvp))
+ : &PL_sv_undef);
+ XPUSHs(argok
+ ? newSVpvn(SvPVX_const(*argsvp), SvCUR(*argsvp))
+ : &PL_sv_undef);
if (flgok)
XPUSHi(SvIVX(*flgsvp));
else