summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-12-21 22:02:30 -0700
committerKarl Williamson <khw@cpan.org>2014-12-30 21:18:48 -0700
commit75697d6e4ef98ece405210de48e7529d01b619bf (patch)
tree563dd7b4f3463ea5fcea5315648d4416007cae6e /regcomp.c
parentec98ebe8f6cc848416a16d83adfc2b850b3348b3 (diff)
downloadperl-75697d6e4ef98ece405210de48e7529d01b619bf.tar.gz
Empty \N{} in regex pattern should force /d to /u
\N{} is for Unicode names, even if the name is actually omitted. (Accepting an empty name is, I believe, an accident, and now is supported only for backwards compatibility.)
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index e6ddb803aa..c2521a97cc 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11174,6 +11174,8 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode** node_p,
vFAIL("\\N{NAME} must be resolved by the lexer");
}
+ RExC_uni_semantics = 1; /* Unicode named chars imply Unicode semantics */
+
if (endbrace == RExC_parse) { /* empty: \N{} */
if (node_p) {
*node_p = reg_node(pRExC_state,NOTHING);
@@ -11185,7 +11187,6 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode** node_p,
return 0;
}
- RExC_uni_semantics = 1; /* Unicode named chars imply Unicode semantics */
RExC_parse += 2; /* Skip past the 'U+' */
endchar = RExC_parse + strcspn(RExC_parse, ".}");