In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/dcb21ed695e1607e7f38d24d60022fda943f55e2?hp=c678e61761316cef95aa1177d92c245639595161>

- Log -----------------------------------------------------------------
commit dcb21ed695e1607e7f38d24d60022fda943f55e2
Author: Nicholas Clark <[email protected]>
Date:   Fri Oct 22 07:41:39 2010 +0100

    S_tokeq()'s fast scan loop should terminate on \\ not \
    
    As-was, it would drop out of the scanner into the backslashed-backslash
    processing loop earlier than need be, and hence would be copying the octets
    of strings (in place) as soon as any backslash had been seen. Now it defers
    copying until copying is actually unavoidable.
-----------------------------------------------------------------------

Summary of changes:
 toke.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/toke.c b/toke.c
index 731c2b4..b6f9cc9 100644
--- a/toke.c
+++ b/toke.c
@@ -2253,7 +2253,8 @@ S_tokeq(pTHX_ SV *sv)
     if (SvTYPE(sv) >= SVt_PVIV && SvIVX(sv) == -1)
        goto finish;
     send = s + len;
-    while (s < send && *s != '\\')
+    /* This is relying on the SV being "well formed" with a trailing '\0'  */
+    while (s < send && !(*s == '\\' && s[1] == '\\'))
        s++;
     if (s == send)
        goto finish;

--
Perl5 Master Repository

Reply via email to