Change 19033 by [EMAIL PROTECTED] on 2003/03/20 01:30:46
file test operators weren't doing the right thing if the SV
passed to them wasn't NUL-terminated
Affected files ...
... //depot/maint-5.6/perl/doio.c#21 edit
Differences ...
==== //depot/maint-5.6/perl/doio.c#21 (text) ====
Index: perl/doio.c
--- perl/doio.c#20~16333~ Thu May 2 00:08:42 2002
+++ perl/doio.c Wed Mar 19 17:30:46 2003
@@ -1278,7 +1278,7 @@
else {
SV* sv = POPs;
char *s;
- STRLEN n_a;
+ STRLEN len;
PUTBACK;
if (SvTYPE(sv) == SVt_PVGV) {
gv = (GV*)sv;
@@ -1289,9 +1289,10 @@
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'))
End of Patch.