summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-07 05:52:02 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-07 05:52:02 +0000
commitdfcb284a2bcae98854733134f50bc110c487b8a3 (patch)
tree428b48563b3b3587755397ccae421386758ce16c /pp.c
parent7f66633bd788f56bb4e77473ec86f45e8cc0614b (diff)
downloadperl-dfcb284a2bcae98854733134f50bc110c487b8a3.tar.gz
repeat operator (x) doesn't preserve utf8-ness
p4raw-id: //depot/perl@6085
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index d2a8c64af4..03ced37ca9 100644
--- a/pp.c
+++ b/pp.c
@@ -1076,10 +1076,10 @@ PP(pp_repeat)
SP -= items;
}
else { /* Note: mark already snarfed by pp_list */
- SV *tmpstr;
+ SV *tmpstr = POPs;
STRLEN len;
+ bool isutf = SvUTF8(tmpstr) ? TRUE : FALSE;
- tmpstr = POPs;
SvSetSV(TARG, tmpstr);
SvPV_force(TARG, len);
if (count != 1) {
@@ -1092,7 +1092,10 @@ PP(pp_repeat)
}
*SvEND(TARG) = '\0';
}
- (void)SvPOK_only(TARG);
+ if (isutf)
+ (void)SvPOK_only_UTF8(TARG);
+ else
+ (void)SvPOK_only(TARG);
PUSHTARG;
}
RETURN;