summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-04-08 12:13:06 -0600
committerKarl Williamson <khw@cpan.org>2016-05-09 11:13:49 -0600
commit1656665e748b80ad0727244ca0eae788f521f64f (patch)
tree345c0e8a3a49e28cc2ca78eb3c081839983714e7 /regcomp.c
parenta27615d67331a9b30d8e49e84614dffb27b77acc (diff)
downloadperl-1656665e748b80ad0727244ca0eae788f521f64f.tar.gz
Require literal '{' in patterns to be escaped
This has been deprecated since v5.16, with a deprecation message displayed starting in v5.22.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/regcomp.c b/regcomp.c
index 48d817b4f9..36626e3e3b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13190,14 +13190,13 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
} /* End of switch on '\' */
break;
case '{':
- /* Currently we don't warn when the lbrace is at the start
+ /* Currently we don't care if the lbrace is at the start
* of a construct. This catches it in the middle of a
* literal string, or when it's the first thing after
* something like "\b" */
- if (! SIZE_ONLY
- && (len || (p > RExC_start && isALPHA_A(*(p -1)))))
- {
- ckWARNregdep(p + 1, "Unescaped left brace in regex is deprecated, passed through");
+ if (len || (p > RExC_start && isALPHA_A(*(p -1)))) {
+ RExC_parse = p + 1;
+ vFAIL("Unescaped left brace in regex is illegal");
}
/*FALLTHROUGH*/
default: /* A literal character */