Make scan_num() reëntrant, as suggested in
[p5sagit/p5-mst-13.2.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index a12d8d4..a713ea1 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -116,13 +116,7 @@ Perl_is_utf8_char(pTHX_ U8 *s)
     if (!(u & 0x40))
        return 0;
 
-    if      (!(u & 0x20))      { len = 2; }
-    else if (!(u & 0x10))      { len = 3; }
-    else if (!(u & 0x08))      { len = 4; }
-    else if (!(u & 0x04))      { len = 5; }
-    else if (!(u & 0x02))      { len = 6; }
-    else if (!(u & 0x01))      { len = 7; }
-    else                       { len = 13; } /* whoa! */
+    len = UTF8SKIP(s);
 
     slen = len - 1;
     s++;
@@ -910,11 +904,7 @@ Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none)
     PUTBACK;
     ENTER;
     SAVEI32(PL_hints);
-#ifdef EBCDIC
-    PL_hints = HINT_BYTE;
-#else
     PL_hints = 0;
-#endif
     save_re_context();
     if (PL_curcop == &PL_compiling)    /* XXX ought to be handled by lex_start */
        strncpy(tmpbuf, PL_tokenbuf, sizeof tmpbuf);