This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Pay attention to the comments that Dave writes.
authorNicholas Clark <nick@ccl4.org>
Mon, 13 Jun 2005 22:29:00 +0000 (22:29 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 13 Jun 2005 22:29:00 +0000 (22:29 +0000)
p4raw-id: //depot/perl@24829

sv.c

diff --git a/sv.c b/sv.c
index d161b11..9713707 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -758,15 +758,12 @@ S_varname(pTHX_ GV *gv, const char *gvtype, PADOFFSET targ,
     else {
        U32 u;
        CV *cv = find_runcv(&u);
-       STRLEN len;
-       const char *str;
        if (!cv || !CvPADLIST(cv))
            return Nullsv;;
        av = (AV*)(*av_fetch(CvPADLIST(cv), 0, FALSE));
        sv = *av_fetch(av, targ, FALSE);
        /* SvLEN in a pad name is not to be trusted */
-       str = SvPV_const(sv,len);
-       sv_setpvn(name, str, len);
+       sv_setpv(name, SvPV_nolen_const(sv));
     }
 
     if (subscript_type == FUV_SUBSCRIPT_HASH) {