diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2002-09-11 15:22:45 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-10-01 08:10:21 +0000 |
commit | cb50f42d44feb5486b1014e87f10579f0b7cddbf (patch) | |
tree | a6287078174bb8819276c355a6b5d93123e8837a /regexec.c | |
parent | 0d1032abc6ecb94ee2955275dc38423a9d34216c (diff) | |
download | perl-cb50f42d44feb5486b1014e87f10579f0b7cddbf.tar.gz |
Re: sv_2pv_flags and ROK and UTF8 flags
Message-ID: <lSCg9gzkgymX092yn@efn.org>
p4raw-id: //depot/perl@17947
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2821,6 +2821,7 @@ S_regmatch(pTHX_ regnode *prog) MAGIC *mg = Null(MAGIC*); re_cc_state state; CHECKPOINT cp, lastcp; + int toggleutf; if(SvROK(ret) || SvRMAGICAL(ret)) { SV *sv = SvROK(ret) ? SvRV(ret) : ret; @@ -2841,6 +2842,7 @@ S_regmatch(pTHX_ regnode *prog) I32 onpar = PL_regnpar; Zero(&pm, 1, PMOP); + if (DO_UTF8(ret)) pm.op_pmdynflags |= PMdf_DYN_UTF8; re = CALLREGCOMP(aTHX_ t, t + len, &pm); if (!(SvFLAGS(ret) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY))) @@ -2873,6 +2875,9 @@ S_regmatch(pTHX_ regnode *prog) *PL_reglastcloseparen = 0; PL_reg_call_cc = &state; PL_reginput = locinput; + toggleutf = ((PL_reg_flags & RF_utf8) != 0) ^ + ((re->reganch & ROPT_UTF8) != 0); + if (toggleutf) PL_reg_flags ^= RF_utf8; /* XXXX This is too dramatic a measure... */ PL_reg_maxiter = 0; @@ -2887,6 +2892,7 @@ S_regmatch(pTHX_ regnode *prog) PL_regcc = state.cc; PL_reg_re = state.re; cache_re(PL_reg_re); + if (toggleutf) PL_reg_flags ^= RF_utf8; /* XXXX This is too dramatic a measure... */ PL_reg_maxiter = 0; @@ -2903,6 +2909,7 @@ S_regmatch(pTHX_ regnode *prog) PL_regcc = state.cc; PL_reg_re = state.re; cache_re(PL_reg_re); + if (toggleutf) PL_reg_flags ^= RF_utf8; /* XXXX This is too dramatic a measure... */ PL_reg_maxiter = 0; |