diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2000-10-30 13:09:55 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-31 14:22:15 +0000 |
commit | 287eef1b08ebb0e1197065c3c079b4a2d7ee452b (patch) | |
tree | 4057ecc373cbb75af78c386bbd116d78aaa05834 /doop.c | |
parent | e38197b302fd8280036f3650932b6defd2b7e0cc (diff) | |
download | perl-287eef1b08ebb0e1197065c3c079b4a2d7ee452b.tar.gz |
Be more lenient on bad UTF-8 when doing bit arithmetics.
Subject: Re: [ID 20000918.005] ~ on wide chars
Message-ID: <jQl/5gzkgWYL092yn@efn.org>
(The ord() part of the patch skipped.)
p4raw-id: //depot/perl@7500
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -968,10 +968,10 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right) switch (optype) { case OP_BIT_AND: while (lulen && rulen) { - luc = utf8_to_uv((U8*)lc, lulen, &ulen, 0); + luc = utf8_to_uv((U8*)lc, lulen, &ulen, UTF8_ALLOW_ANY); lc += ulen; lulen -= ulen; - ruc = utf8_to_uv((U8*)rc, rulen, &ulen, 0); + ruc = utf8_to_uv((U8*)rc, rulen, &ulen, UTF8_ALLOW_ANY); rc += ulen; rulen -= ulen; duc = luc & ruc; @@ -983,10 +983,10 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right) break; case OP_BIT_XOR: while (lulen && rulen) { - luc = utf8_to_uv((U8*)lc, lulen, &ulen, 0); + luc = utf8_to_uv((U8*)lc, lulen, &ulen, UTF8_ALLOW_ANY); lc += ulen; lulen -= ulen; - ruc = utf8_to_uv((U8*)rc, rulen, &ulen, 0); + ruc = utf8_to_uv((U8*)rc, rulen, &ulen, UTF8_ALLOW_ANY); rc += ulen; rulen -= ulen; duc = luc ^ ruc; @@ -995,10 +995,10 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right) goto mop_up_utf; case OP_BIT_OR: while (lulen && rulen) { - luc = utf8_to_uv((U8*)lc, lulen, &ulen, 0); + luc = utf8_to_uv((U8*)lc, lulen, &ulen, UTF8_ALLOW_ANY); lc += ulen; lulen -= ulen; - ruc = utf8_to_uv((U8*)rc, rulen, &ulen, 0); + ruc = utf8_to_uv((U8*)rc, rulen, &ulen, UTF8_ALLOW_ANY); rc += ulen; rulen -= ulen; duc = luc | ruc; |