diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-02-12 21:08:50 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-02-12 22:02:24 -0700 |
commit | 216bfc0a080a7190b7235110e12114b87f6e7b56 (patch) | |
tree | 910497d63b467e597ec80e5a6ec926c5fbf75801 /regcomp.c | |
parent | 4b056c0626143ea9b19431c50c5587207f7bfc77 (diff) | |
download | perl-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |