diff options
author | Karl Williamson <khw@cpan.org> | 2014-12-21 22:02:30 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-12-30 21:18:48 -0700 |
commit | 75697d6e4ef98ece405210de48e7529d01b619bf (patch) | |
tree | 563dd7b4f3463ea5fcea5315648d4416007cae6e /regcomp.c | |
parent | ec98ebe8f6cc848416a16d83adfc2b850b3348b3 (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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, ".}"); |