summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-02-05 13:07:38 -0700
committerKarl Williamson <khw@cpan.org>2015-02-05 13:54:23 -0700
commit7dbd4c448e073ab79489ffeb25479e30e283d84d (patch)
tree0b7822356d38ff4dd2e93c5501e2c956694e8cd2 /regcomp.c
parentc9a74c77cc7250708801cd921a86741bdcbda6cd (diff)
downloadperl-7dbd4c448e073ab79489ffeb25479e30e283d84d.tar.gz
regcomp.c: Warn on [:^posix:] not being in []
A POSIX character class is has to be in a bracketed character class. A warning is issued when something appearing to be one is found outside. Until this commit the warning wasn't raised for negated classes.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index edab543e42..0d6d344970 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13864,6 +13864,9 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
const char *s = RExC_parse;
const char c = *s++;
+ if (*s == '^') {
+ s++;
+ }
while (isWORDCHAR(*s))
s++;
if (*s && c == *s && s[1] == ']') {