tweaks from Simon Cozens to further fix tr/// under utf8
Jarkko Hietaniemi [Wed, 28 Jun 2000 15:40:22 +0000 (15:40 +0000)]
p4raw-id: //depot/cfgperl@6256

doop.c

diff --git a/doop.c b/doop.c
index a7634c4..7dc5a2b 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -469,7 +469,6 @@ Perl_do_trans(pTHX_ SV *sv)
     I32 hasutf = (PL_op->op_private & 
                     (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF));
 
-    PL_op->op_private &= ~hasutf;
     if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL))
        Perl_croak(aTHX_ PL_no_modify);
 
@@ -483,7 +482,7 @@ Perl_do_trans(pTHX_ SV *sv)
 
     DEBUG_t( Perl_deb(aTHX_ "2.TBL\n"));
 
-    switch (PL_op->op_private & 63) {
+    switch (PL_op->op_private & ~hasutf & 63) {
     case 0:
     if (hasutf)
         return do_trans_simple_utf8(sv);