summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-02-20 11:27:03 -0700
committerKarl Williamson <public@khwilliamson.com>2012-02-28 17:41:14 -0700
commit96f54887615ec13b0713f735c3ec6618468ec51f (patch)
treee3131b3f219a15d8e94f601c12d45ef079f1ae00 /regcomp.c
parentb4069bca6054692e4fffa8e9e04572511e910fbd (diff)
downloadperl-96f54887615ec13b0713f735c3ec6618468ec51f.tar.gz
(?foo:...) loses passed in charset
This commit looks for the passed-in charset, and overrides it only if it is /d and the pattern requires /u. Previously the passed-in value was ignored.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 1e1dcfd3a6..1d077e3ee4 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -8010,9 +8010,12 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
U32 posflags = 0, negflags = 0;
U32 *flagsp = &posflags;
char has_charset_modifier = '\0';
- regex_charset cs = (RExC_utf8 || RExC_uni_semantics)
- ? REGEX_UNICODE_CHARSET
- : REGEX_DEPENDS_CHARSET;
+ regex_charset cs = get_regex_charset(RExC_flags);
+ if (cs == REGEX_DEPENDS_CHARSET
+ && (RExC_utf8 || RExC_uni_semantics))
+ {
+ cs = REGEX_UNICODE_CHARSET;
+ }
while (*RExC_parse) {
/* && strchr("iogcmsx", *RExC_parse) */