This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Only try to fold foldable chars
authorKarl Williamson <public@khwilliamson.com>
Thu, 28 Jun 2012 23:13:18 +0000 (17:13 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 25 Jul 2012 03:13:44 +0000 (21:13 -0600)
This uses the new table that a previous commit caused mktables to
generate which more precisely determines which Unicode characters
participate in folds.  This avoids trying to calculate a fold that we
can know beforehand doesn't have a fold.

regcomp.c

index adeec44..b2c1f5c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11881,10 +11881,12 @@ parseit:
         }
         else {
 
-            /* This is a list of all the characters that participate in folds
-             * (except marks, etc in multi-char folds */
+            /* Here, there are non-Latin1 code points, so we will have to go
+             * fetch the list of all the characters that participate in folds
+             */
             if (! PL_utf8_foldable) {
-                SV* swash = swash_init("utf8", "Cased", &PL_sv_undef, 1, 0);
+                SV* swash = swash_init("utf8", "_Perl_Any_Folds",
+                                       &PL_sv_undef, 1, 0);
                 PL_utf8_foldable = _swash_to_invlist(swash);
                 SvREFCNT_dec(swash);
             }