If doing rcatline no point rescanning each time
Jarkko Hietaniemi [Wed, 10 Sep 2003 08:02:55 +0000 (08:02 +0000)]
the beginning of the SV for utf8 validity.

p4raw-id: //depot/perl@21155

pp_hot.c

index 1de483c..0c4c692 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1570,10 +1570,12 @@ Perl_do_readline(pTHX)
            RETURN;
        }
        if (SvUTF8(sv)) {
+            U8 *s = (U8*)SvPVX(sv) + offset;
+            STRLEN len = SvCUR(sv) - offset;
             U8 *f;
 
             if (ckWARN(WARN_UTF8) &&
-                !Perl_is_utf8_string_loc(aTHX_ (U8*)SvPVX(sv), SvCUR(sv), &f))
+                !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
                  /* Emulate :encoding(utf8) warning in the same case. */
                  Perl_warner(aTHX_ packWARN(WARN_UTF8),
                              "utf8 \"\\x%02X\" does not map to Unicode",