summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-02-12 21:08:50 -0700
committerKarl Williamson <public@khwilliamson.com>2011-02-12 22:02:24 -0700
commit216bfc0a080a7190b7235110e12114b87f6e7b56 (patch)
tree910497d63b467e597ec80e5a6ec926c5fbf75801 /regcomp.c
parent4b056c0626143ea9b19431c50c5587207f7bfc77 (diff)
downloadperl-216bfc0a080a7190b7235110e12114b87f6e7b56.tar.gz
regcomp.c: include { in unregcognized \q{ warning
The warning message about regex unrecognized escapes passed through is changed to include any literal '{' following the 2-char escape. e.g., "\q{" will include the { in the message as part of the escape.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 43fa7f0068..62e9448184 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -8558,8 +8558,13 @@ tryagain:
FAIL("Trailing \\");
/* FALL THROUGH */
default:
- if (!SIZE_ONLY&& isALPHA(*p))
- ckWARN2reg(p + 1, "Unrecognized escape \\%c passed through", UCHARAT(p));
+ if (!SIZE_ONLY&& isALPHA(*p)) {
+ /* Include any { following the alpha to emphasize
+ * that it could be part of an escape at some point
+ * in the future */
+ int len = (*(p + 1) == '{') ? 2 : 1;
+ ckWARN3reg(p + len, "Unrecognized escape \\%.*s passed through", len, p);
+ }
goto normal_default;
}
break;