This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix RT-70998: qq{\x{30ab}} =~ /\xab|\xa9/ produces warnings origin/compile
authorYves Orton <demerphq@gmail.com>
Tue, 2 Nov 2010 10:29:18 +0000 (11:29 +0100)
committerYves Orton <demerphq@gmail.com>
Tue, 2 Nov 2010 10:44:58 +0000 (11:44 +0100)
regexec.c

index 2c9b852..2e15b45 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1780,10 +1780,16 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
                                         PerlIO_printf( Perl_debug_log,
                                             " Scanning for legal start char...\n");
                                     }
-                                );            
-                                while ( uc <= (U8*)last_start  && !BITMAP_TEST(bitmap,*uc) ) {
-                                    uc++;
-                                }
+                                );
+                               if (utf8_target) {
+                                   while ( uc <= (U8*)last_start && !BITMAP_TEST(bitmap,*uc) ) {
+                                       uc += UTF8SKIP(uc);
+                                   }
+                               } else {
+                                   while ( uc <= (U8*)last_start  && !BITMAP_TEST(bitmap,*uc) ) {
+                                       uc++;
+                                   }
+                               }
                                 s= (char *)uc;
                             }
                             if (uc >(U8*)last_start) break;