diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-10-18 10:44:35 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-10-18 10:44:35 +0000 |
commit | 19bad6733a83fa572b0d6a19b4693ea22c241ab0 (patch) | |
tree | 4d64f30b7146c090b4192d6c8e7bb13e2b773675 /toke.c | |
parent | c099d646ae4693eeb591d4c8cd9b629962f6b7e4 (diff) | |
download | perl-19bad6733a83fa572b0d6a19b4693ea22c241ab0.tar.gz |
Don't call strlen() on CopFILE() for the unthreaded case, because the
length can be obtained via CopFILESV().
p4raw-id: //depot/perl@32129
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -824,8 +824,18 @@ S_incline(pTHX_ const char *s) if (t - s > 0) { const STRLEN len = t - s; #ifndef USE_ITHREADS - const char * const cf = CopFILE(PL_curcop); - STRLEN tmplen = cf ? strlen(cf) : 0; + SV *const temp_sv = CopFILESV(PL_curcop); + const char *cf; + STRLEN tmplen; + + if (temp_sv) { + cf = SvPVX(temp_sv); + tmplen = SvCUR(temp_sv); + } else { + cf = NULL; + tmplen = 0; + } + if (tmplen > 7 && strnEQ(cf, "(eval ", 6)) { /* must copy *{"::_<(eval N)[oldfilename:L]"} * to *{"::_<newfilename"} */ |