regcomp.c: Add locale for \d
authorKarl Williamson <public@khwilliamson.com>
Mon, 6 Dec 2010 15:35:17 +0000 (08:35 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 8 Dec 2010 02:52:42 +0000 (18:52 -0800)
The DIGITL and NDIGITL regnodes were not being generated; instead
regular DIGIT and NDIGIT regnodes were even under locale.

This means no one has probably ever used Perl on a locale that changed
the digits.

regcomp.c

index 6f3bfe8..4fb8c37 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7445,11 +7445,19 @@ tryagain:
            *flagp |= HASWIDTH|SIMPLE;
            goto finish_meta_pat;
        case 'd':
-           ret = reg_node(pRExC_state, DIGIT);
+            if (LOC) {
+                ret = reg_node(pRExC_state, (U8)(DIGITL));
+            } else {
+                ret = reg_node(pRExC_state, (U8)(DIGIT));
+            }
            *flagp |= HASWIDTH|SIMPLE;
            goto finish_meta_pat;
        case 'D':
-           ret = reg_node(pRExC_state, NDIGIT);
+            if (LOC) {
+                ret = reg_node(pRExC_state, (U8)(NDIGITL));
+            } else {
+                ret = reg_node(pRExC_state, (U8)(NDIGIT));
+            }
            *flagp |= HASWIDTH|SIMPLE;
            goto finish_meta_pat;
        case 'R':