summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2000-11-10 01:47:15 -0800
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-13 04:05:07 +0000
commit80190d9703c19fb2734fff4856a03a899b8258e2 (patch)
tree83f9af82cb7a2699ca5ca248e9907ac52b3924a8 /doop.c
parent25f2c9730121ce89623b714ac20d82079344faf4 (diff)
downloadperl-80190d9703c19fb2734fff4856a03a899b8258e2.tar.gz
Tweak the definition of the bit complement on UTF-8 data:
if none of the characters in the string are > 0xff, the result is a complemented byte string, not a (UTF-8) char string. Based on the summary in Subject: Re: [ID 20000918.005] ~ on wide chars Message-ID: <jSDD6gzkgi/T092yn@efn.org> This should give us the maximum backward (pre-char string) compatibility and utf8 compatibility. The other alternative would be to limit the bit complement to be always byte only, taking the least significant byte of the chars. p4raw-id: //depot/perl@7665
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/doop.c b/doop.c
index 9fd7dfa49f..3d22eb41fe 100644
--- a/doop.c
+++ b/doop.c
@@ -926,7 +926,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
if (left_utf && !right_utf)
sv_utf8_upgrade(right);
- if (!left_utf && right_utf)
+ else if (!left_utf && right_utf)
sv_utf8_upgrade(left);
if (sv != left || (optype != OP_BIT_AND && !SvOK(sv) && !SvGMAGICAL(sv)))