This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: change pattern to utf8 if needed in \N{}
authorKarl Williamson <public@khwilliamson.com>
Wed, 8 Aug 2012 03:06:06 +0000 (21:06 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 12 Aug 2012 01:32:31 +0000 (19:32 -0600)
This patch is in preparation for future patches that will no longer
always make any pattern that contains \N{} be encoded in UTF-8.  Thus
this patch doesn't actually change anything, but enables future ones.

regcomp.c

index 09a8f27..11f7f1d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10533,6 +10533,9 @@ tryagain:
                             goto loopdone;
                         }
                         p = RExC_parse;
+                        if (ender > 0xff) {
+                            REQUIRE_UTF8;
+                        }
                         break;
                    case 'r':
                        ender = '\r';