summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-26 18:25:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-26 18:25:51 +0000
commit4a176938c74b8176b4a677d188d6588d5e88332e (patch)
treef57943180f8cd708f8030dad1f0f09374754800f /pp_hot.c
parentd38487415f5c04a655b8d9a86fe64aa945ae1cba (diff)
downloadperl-4a176938c74b8176b4a677d188d6588d5e88332e.tar.gz
Further tweaking on the Unicode s///.
p4raw-id: //depot/perl@17366
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7837f6409b..ae1b1c209e 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1983,16 +1983,20 @@ PP(pp_subst)
/* known replacement string? */
if (dstr) {
- c = SvPV(dstr, clen);
- doutf8 = DO_UTF8(dstr);
/* replacement needing upgrading? */
if (DO_UTF8(TARG) && !doutf8) {
- SV *nsv = sv_2mortal(newSVpvn(c, clen));
+ SV *nsv = sv_newmortal();
+ SvSetSV(nsv, dstr);
if (PL_encoding)
sv_recode_to_utf8(nsv, PL_encoding);
else
sv_utf8_upgrade(nsv);
c = SvPV(nsv, clen);
+ doutf8 = TRUE;
+ }
+ else {
+ c = SvPV(dstr, clen);
+ doutf8 = DO_UTF8(dstr);
}
}
else {