Integrate from maint:
Jarkko Hietaniemi [Fri, 15 Aug 2003 15:37:36 +0000 (15:37 +0000)]
[ 20724]
No peeking before the buffer.
(This was probably the random failure showing up
 in Solaris with t/uni/tr_7jis.t)
p4raw-link: @20724 on //depot/maint-5.8/perl: bc636a03071ec9785e0be7bacbc34e6f3ee1225c

p4raw-id: //depot/perl@20725
p4raw-integrated: from //depot/maint-5.8/perl@20721 'merge in' toke.c
(@20522..)

toke.c

diff --git a/toke.c b/toke.c
index adc7d26..aa20096 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6996,7 +6996,7 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
                    goto read_more_line;
                else {
                    /* handle quoted delimiters */
-                   if (*(svlast-1) == '\\') {
+                   if (SvCUR(sv) > 1 && *(svlast-1) == '\\') {
                        char *t;
                        for (t = svlast-2; t >= SvPVX(sv) && *t == '\\';)
                            t--;