Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 9543710..0407e69 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2606,7 +2606,7 @@ tryagain:
                                FAIL("Missing right brace on \\x{}");
                            else if (UTF) {
                                numlen = 1;     /* allow underscores */
-                               ender = (UV)scan_hex(p + 1, e - p, &numlen);
+                               ender = (UV)scan_hex(p + 1, e - p - 1, &numlen);
                                /* numlen is generous */
                                if (numlen + len >= 127) {
                                    p--;
@@ -2646,7 +2646,8 @@ tryagain:
                            FAIL("trailing \\ in regexp");
                        /* FALL THROUGH */
                    default:
-                       if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(*p))
+                       if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+                           isALPHA(*p) && *p != '_')
                            Perl_warner(aTHX_ WARN_REGEXP, 
                                        "/%.127s/: Unrecognized escape \\%c passed through",
                                        PL_regprecomp,
@@ -2959,7 +2960,8 @@ S_regclass(pTHX)
                PL_regcomp_parse += numlen;
                break;
            default:
-               if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(value))
+               if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+                   isALPHA(value) && value != (UV)'_')
                    Perl_warner(aTHX_ WARN_REGEXP, 
                                "/%.127s/: Unrecognized escape \\%c in character class passed through",
                                PL_regprecomp,
@@ -3443,7 +3445,8 @@ S_regclassutf8(pTHX)
                PL_regcomp_parse += numlen;
                break;
            default:
-               if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(value))
+               if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+                   isALPHA(value) && value != (U32)'_')
                    Perl_warner(aTHX_ WARN_REGEXP, 
                                "/%.127s/: Unrecognized escape \\%c in character class passed through",
                                PL_regprecomp,