break;
case '\014': /* $^L */
- sv_setpv(GvSV(gv),"\f");
+ sv_setpvn(GvSV(gv),"\f",1);
PL_formfeed = GvSV(gv);
break;
case ';':
- sv_setpv(GvSV(gv),"\034");
+ sv_setpvn(GvSV(gv),"\034",1);
break;
case ']':
{
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 */
- sv_setpv(name, SvPV_nolen(sv));
+ str = SvPV(sv,len);
+ sv_setpvn(name, str, len);
}
if (subscript_type == FUV_SUBSCRIPT_HASH) {
: DEFSV))
{
sv = sv_newmortal();
- sv_setpv(sv, "$_");
+ sv_setpvn(sv, "$_", 2);
return sv;
}
}
register SV *sv;
new_SV(sv);
- if (!len)
- len = strlen(s);
- sv_setpvn(sv,s,len);
+ sv_setpvn(sv,s,len ? len : strlen(s));
return sv;
}
if (HvARRAY((HV*)sstr)) {
STRLEN i = 0;
- bool sharekeys = !!HvSHAREKEYS(sstr);
- XPVHV *dxhv = (XPVHV*)SvANY(dstr);
- XPVHV *sxhv = (XPVHV*)SvANY(sstr);
+ const bool sharekeys = !!HvSHAREKEYS(sstr);
+ XPVHV * const dxhv = (XPVHV*)SvANY(dstr);
+ XPVHV * const sxhv = (XPVHV*)SvANY(sstr);
char *darray;
New(0, darray,
PERL_HV_ARRAY_ALLOC_BYTES(dxhv->xhv_max+1)
if (strNE(a,b))
return FALSE;
if (fa == a)
- sv_setpv(tmpsv, ".");
+ sv_setpvn(tmpsv, ".", 1);
else
sv_setpvn(tmpsv, a, fa - a);
if (PerlLIO_stat(SvPVX_const(tmpsv), &tmpstatbuf1) < 0)
return FALSE;
if (fb == b)
- sv_setpv(tmpsv, ".");
+ sv_setpvn(tmpsv, ".", 1);
else
sv_setpvn(tmpsv, b, fb - b);
if (PerlLIO_stat(SvPVX_const(tmpsv), &tmpstatbuf2) < 0)