summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-20 05:23:15 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-20 05:23:15 +0000
commit4ecd490ccf7bf09140e24e001c5acc2d417d685c (patch)
treec43dc9282d0b378beb87dc2a0ad71b929d40c9f6 /doio.c
parent7f274f0f6c9842ea688f851b8245ef7d42203120 (diff)
downloadperl-4ecd490ccf7bf09140e24e001c5acc2d417d685c.tar.gz
Integrate:
[ 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..)
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/doio.c b/doio.c
index 091e02b944..a1cc42abf0 100644
--- a/doio.c
+++ b/doio.c
@@ -1321,7 +1321,7 @@ Perl_my_stat(pTHX)
else {
SV* sv = POPs;
char *s;
- STRLEN n_a;
+ STRLEN len;
PUTBACK;
if (SvTYPE(sv) == SVt_PVGV) {
gv = (GV*)sv;
@@ -1332,9 +1332,10 @@ Perl_my_stat(pTHX)
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'))