Change 31328 by [EMAIL PROTECTED] on 2007/06/03 15:36:25

        Subject: [PATCH] Re: BBC(Bleadperl Breaks CPAN) Today: String::Multibyte
        From: demerphq <[EMAIL PROTECTED]>
        Date: Sun, 3 Jun 2007 17:21:55 +0200
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/regcomp.c#592 edit
... //depot/perl/t/op/pat.t#289 edit

Differences ...

==== //depot/perl/regcomp.c#592 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#591~31303~   2007-05-29 01:49:06.000000000 -0700
+++ perl/regcomp.c      2007-06-03 08:36:25.000000000 -0700
@@ -1966,7 +1966,8 @@
                 }
                 if ( count == 1 ) {
                     SV **tmp = av_fetch( revcharmap, idx, 0);
-                    char *ch = SvPV_nolen( *tmp );
+                    STRLEN len;
+                    char *ch = SvPV( *tmp, len );
                     DEBUG_OPTIMISE_r({
                         SV *sv=sv_newmortal();
                         PerlIO_printf( Perl_debug_log,
@@ -1985,11 +1986,9 @@
                         str=STRING(convert);
                         STR_LEN(convert)=0;
                     }
-                    while (*ch) {
+                    STR_LEN(convert) += len;
+                    while (len--)
                         *str++ = *ch++;
-                        STR_LEN(convert)++;
-                    }
-                    
                } else {
 #ifdef DEBUGGING           
                    if (state>1)

==== //depot/perl/t/op/pat.t#289 (xtext) ====
Index: perl/t/op/pat.t
--- perl/t/op/pat.t#288~31102~  2007-04-27 07:19:15.000000000 -0700
+++ perl/t/op/pat.t     2007-06-03 08:36:25.000000000 -0700
@@ -4381,6 +4381,18 @@
         }
     }
 }
+{
+    local $Message = "BBC(Bleadperl Breaks CPAN) Today: String::Multibyte";
+    my $re  = qr/(?:[\x00-\xFF]{4})/;
+    my $hyp = "\0\0\0-";
+    my $esc = "\0\0\0\\";
+
+    my $str = "$esc$hyp$hyp$esc$esc";
+    my @a = ($str =~ /\G(?:\Q$esc$esc\E|\Q$esc$hyp\E|$re)/g);
+
+    iseq([EMAIL PROTECTED],3);
+    iseq(join('=', @a),"$esc$hyp=$hyp=$esc$esc");
+}
 # Test counter is at bottom of file. Put new tests above here.
 #-------------------------------------------------------------------
 # Keep the following tests last -- they may crash perl
@@ -4462,7 +4474,7 @@
 iseq(0+$::test,$::TestCount,"Got the right number of tests!");
 # Don't forget to update this!
 BEGIN {
-    $::TestCount = 1948;
+    $::TestCount = 1950;
     print "1..$::TestCount\n";
 }
 
End of Patch.

Reply via email to