[ 19033]
file test operators weren't doing the right thing if the SV
passed to them wasn't NUL-terminated
[ 19034]
ensure SVs returned by Win32::Get{Short,Full}PathName() are
NUL-terminated
p4raw-link: @19034 on //depot/maint-5.6/perl:
d453a28c5f70420dd114c2f0f61ec1aaf34109e0
p4raw-link: @19033 on //depot/maint-5.6/perl:
1ad7974d3a92321c870ce2bd5ce4e57098b51c10
p4raw-id: //depot/perl@19036
p4raw-integrated: from //depot/maint-5.6/perl@19028 'merge in' doio.c
(@16333..) win32/win32.c (@18377..)
else {
SV* sv = POPs;
char *s;
- STRLEN n_a;
+ STRLEN len;
PUTBACK;
if (SvTYPE(sv) == SVt_PVGV) {
gv = (GV*)sv;
goto do_fstat;
}
- s = SvPV(sv, n_a);
+ s = SvPV(sv, len);
PL_statgv = Nullgv;
- sv_setpv(PL_statname, s);
+ sv_setpvn(PL_statname, s, len);
+ s = SvPVX(PL_statname); /* s now NUL-terminated */
PL_laststype = OP_STAT;
PL_laststatval = PerlLIO_stat(s, &PL_statcache);
if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n'))
} while (len >= SvLEN(shortpath) && sv_grow(shortpath,len+1));
if (len) {
SvCUR_set(shortpath,len);
+ *SvEND(shortpath) = '\0';
ST(0) = shortpath;
XSRETURN(1);
}
items = 2;
}
SvCUR_set(fullpath,len);
+ *SvEND(fullpath) = '\0';
ST(0) = fullpath;
XSRETURN(items);
}