diff options
author | Simon Cozens <simon@netthink.co.uk> | 2000-10-10 18:40:17 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-10 19:26:14 +0000 |
commit | 82f2f50342294af2f0534f1cc5ea55eb042b13e2 (patch) | |
tree | 68711a1d2c460bf1927f038613552aae7510efb0 /pp_hot.c | |
parent | ec751b0b28de92f8292739cf0ae5c4f54fd86b6a (diff) | |
download | perl-82f2f50342294af2f0534f1cc5ea55eb042b13e2.tar.gz |
Re: utf8 concat, mg_get
Message-ID: <20001010174017.A13130@pembro4.pmb.ox.ac.uk>
p4raw-id: //depot/perl@7190
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -146,9 +146,17 @@ PP(pp_concat) dPOPTOPssrl; STRLEN len; U8 *s; - bool left_utf = DO_UTF8(left); - bool right_utf = DO_UTF8(right); + bool left_utf; + bool right_utf; + if (TARG == right && SvGMAGICAL(right)) + mg_get(right); + if (SvGMAGICAL(left)) + mg_get(left); + + left_utf = DO_UTF8(left); + right_utf = DO_UTF8(right); + if (left_utf != right_utf) { if (TARG == right && !right_utf) { sv_utf8_upgrade(TARG); /* Now straight binary copy */ @@ -163,9 +171,7 @@ PP(pp_concat) /* Take a copy since we're about to overwrite TARG */ olds = s = (U8*)savepvn((char*)s, len); } - if (SvGMAGICAL(left)) - mg_get(left); - else if (!SvOK(left) && SvTYPE(left) <= SVt_PVMG) + if (!SvOK(left) && SvTYPE(left) <= SVt_PVMG) sv_setpv(left, ""); /* Suppress warning. */ l = (U8*)SvPV(left, targlen); if (TARG != left) @@ -207,8 +213,6 @@ PP(pp_concat) } sv_setpvn(TARG, (char *)s, len); } - else if (SvGMAGICAL(TARG)) - mg_get(TARG); else if (!SvOK(TARG) && SvTYPE(TARG) <= SVt_PVMG) sv_setpv(TARG, ""); /* Suppress warning. */ s = (U8*)SvPV(right,len); |