summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-07 16:05:16 +0000
commit3aa33fe55ba20233f560f0c549294d8e83806012 (patch)
treec1b0f0f2434610012cab3d272fd45f8006b55411 /pp.c
parentdfcb284a2bcae98854733134f50bc110c487b8a3 (diff)
downloadperl-3aa33fe55ba20233f560f0c549294d8e83806012.tar.gz
reverse() and quotemeta() weren't preserving utf8-ness; add tests
p4raw-id: //depot/perl@6087
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 03ced37ca9..e148197c97 100644
--- a/pp.c
+++ b/pp.c
@@ -1078,7 +1078,7 @@ PP(pp_repeat)
else { /* Note: mark already snarfed by pp_list */
SV *tmpstr = POPs;
STRLEN len;
- bool isutf = SvUTF8(tmpstr) ? TRUE : FALSE;
+ bool isutf = DO_UTF8(tmpstr);
SvSetSV(TARG, tmpstr);
SvPV_force(TARG, len);
@@ -2212,7 +2212,6 @@ PP(pp_chr)
tmps = SvPVX(TARG);
*tmps++ = value;
*tmps = '\0';
- SvUTF8_off(TARG); /* decontaminate */
(void)SvPOK_only(TARG);
XPUSHs(TARG);
RETURN;
@@ -2545,7 +2544,7 @@ PP(pp_quotemeta)
}
*d = '\0';
SvCUR_set(TARG, d - SvPVX(TARG));
- (void)SvPOK_only(TARG);
+ (void)SvPOK_only_UTF8(TARG);
}
else
sv_setpvn(TARG, s, len);
@@ -3234,7 +3233,7 @@ PP(pp_reverse)
*up++ = *down;
*down-- = tmp;
}
- (void)SvPOK_only(TARG);
+ (void)SvPOK_only_UTF8(TARG);
}
SP = MARK + 1;
SETTARG;