diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2013-06-04 18:15:24 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-06-06 12:37:49 +0100 |
commit | ae335535b7b6324036b86df6c92202864c0516c3 (patch) | |
tree | b15972500941da407953cfb60ea725e7e6c51fba /regcomp.c | |
parent | f6f12e5902ab71ba3fa84f1efff7569f14e7c302 (diff) | |
download | perl-ae335535b7b6324036b86df6c92202864c0516c3.tar.gz |
[perl #118297] Fix interpolating downgraded variables into upgraded regexp
The code alredy upgraded the pattern if interpolating an upgraded
string into it, but not vice versa. Just use sv_catsv_nomg() instead
of sv_catpvn_nomg(), so that it can upgrade as necessary.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -5088,16 +5088,15 @@ S_concat_pat(pTHX_ RExC_state_t * const pRExC_state, * sv_catsv_nomg(pat, msv); * that allows us to adjust code block indices if * needed */ - STRLEN slen, dlen; + STRLEN dlen; char *dst = SvPV_force_nomg(pat, dlen); - const char *src = SvPV_flags_const(msv, slen, 0); orig_patlen = dlen; if (SvUTF8(msv) && !SvUTF8(pat)) { S_pat_upgrade_to_utf8(aTHX_ pRExC_state, &dst, &dlen, n); sv_setpvn(pat, dst, dlen); SvUTF8_on(pat); } - sv_catpvn_nomg(pat, src, slen); + sv_catsv_nomg(pat, msv); rx = msv; } else |