summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-02-14 16:21:29 +0100
committerSteve Peters <steve@fisharerojo.org>2008-02-14 15:44:14 +0000
commitb16276bb9e16a3b99d6fb450f4e0902e32b01f85 (patch)
tree10028a3c2b2b6bcb4696d2132ceee811e3f94b4f /doio.c
parentfa01e09300100a2f35e7403a33b48963bfdcb712 (diff)
downloadperl-b16276bb9e16a3b99d6fb450f4e0902e32b01f85.tar.gz
doio.c:Perl_my_lstat:/* XXX Do really need to be calling SvPV() all these times? */
From: "Vincent Pit" <perl@profvince.com> Message-ID: <37048.147.210.17.175.1202998889.squirrel@147.210.17.175> p4raw-id: //depot/perl@33310
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 16d8d01c6b..6b0c9f2840 100644
--- a/doio.c
+++ b/doio.c
@@ -1343,6 +1343,7 @@ Perl_my_lstat(pTHX)
static const char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
dSP;
SV *sv;
+ const char *file;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
if (cGVOP_gv == PL_defgv) {
@@ -1369,10 +1370,10 @@ Perl_my_lstat(pTHX)
GvENAME((GV*) SvRV(sv)));
return (PL_laststatval = -1);
}
- /* XXX Do really need to be calling SvPV() all these times? */
- sv_setpv(PL_statname,SvPV_nolen_const(sv));
- PL_laststatval = PerlLIO_lstat(SvPV_nolen_const(sv),&PL_statcache);
- if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV_nolen_const(sv), '\n'))
+ file = SvPV_nolen_const(sv);
+ sv_setpv(PL_statname,file);
+ PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
+ if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(file, '\n'))
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "lstat");
return PL_laststatval;
}