This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Fix \p{} to work on old Unicodes
authorKarl Williamson <khw@cpan.org>
Sat, 5 May 2018 17:38:18 +0000 (11:38 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 25 Jun 2018 13:33:30 +0000 (07:33 -0600)
This change to use one #define instead of a synonym causes the code to
work unchanged on any Unicode version.  The synonym isn't defined in
very old Unicodes, so this wouldn't compile for them.

utf8.c

diff --git a/utf8.c b/utf8.c
index 0b31076..eff42e7 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -6386,8 +6386,8 @@ Perl_parse_uniprop_string(pTHX_ const char * const name, const Size_t len, const
     /* In a few properties, a different property is used under /i.  These are
      * unlikely to change, so are hard-coded here. */
     if (to_fold) {
-        if (   table_index == PL_UPPER
-            || table_index == PL_LOWER
+        if (   table_index == PL_XPOSIXUPPER
+            || table_index == PL_XPOSIXLOWER
             || table_index == PL_TITLE)
         {
             table_index = PL_CASED;