From b16276bb9e16a3b99d6fb450f4e0902e32b01f85 Mon Sep 17 00:00:00 2001 From: Vincent Pit Date: Thu, 14 Feb 2008 16:21:29 +0100 Subject: doio.c:Perl_my_lstat:/* XXX Do really need to be calling SvPV() all these times? */ From: "Vincent Pit" Message-ID: <37048.147.210.17.175.1202998889.squirrel@147.210.17.175> p4raw-id: //depot/perl@33310 --- doio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doio.c') 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; } -- cgit v1.2.1