summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2006-04-03 07:48:44 +0900
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-02 20:58:59 +0000
commit9f7f391326e967b539b86ed051c163bbf8f6e7de (patch)
tree83c9d610d7797ba26e60f74889886eb91f50e6a6 /doop.c
parenta98fe34d09e2476f1a21bfb9dc730dc9ab02b0b4 (diff)
downloadperl-9f7f391326e967b539b86ed051c163bbf8f6e7de.tar.gz
Re: [perl #38293] chr(65535) should be allowed in regexes
Message-Id: <20060402224657.B942.BQW10602@nifty.com> p4raw-id: //depot/perl@27688
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/doop.c b/doop.c
index 2c1ce81a38..3e6066529a 100644
--- a/doop.c
+++ b/doop.c
@@ -69,7 +69,7 @@ S_do_trans_simple(pTHX_ SV *sv)
I32 ch;
/* Need to check this, otherwise 128..255 won't match */
- const UV c = utf8n_to_uvchr(s, send - s, &ulen, 0);
+ const UV c = utf8n_to_uvchr(s, send - s, &ulen, UTF8_ALLOW_DEFAULT);
if (c < 0x100 && (ch = tbl[c]) >= 0) {
matches++;
d = uvchr_to_utf8(d, ch);
@@ -119,7 +119,7 @@ S_do_trans_count(pTHX_ SV *sv)
const I32 complement = PL_op->op_private & OPpTRANS_COMPLEMENT;
while (s < send) {
STRLEN ulen;
- const UV c = utf8n_to_uvchr(s, send - s, &ulen, 0);
+ const UV c = utf8n_to_uvchr(s, send - s, &ulen, UTF8_ALLOW_DEFAULT);
if (c < 0x100) {
if (tbl[c] >= 0)
matches++;
@@ -209,7 +209,8 @@ S_do_trans_complex(pTHX_ SV *sv)
UV pch = 0xfeedface;
while (s < send) {
STRLEN len;
- const UV comp = utf8_to_uvchr(s, &len);
+ const UV comp = utf8n_to_uvchr(s, send - s, &len,
+ UTF8_ALLOW_DEFAULT);
I32 ch;
if (comp > 0xff) {
@@ -254,7 +255,8 @@ S_do_trans_complex(pTHX_ SV *sv)
else {
while (s < send) {
STRLEN len;
- const UV comp = utf8_to_uvchr(s, &len);
+ const UV comp = utf8n_to_uvchr(s, send - s, &len,
+ UTF8_ALLOW_DEFAULT);
I32 ch;
if (comp > 0xff) {
if (!complement) {
@@ -540,7 +542,7 @@ S_do_trans_complex_utf8(pTHX_ SV *sv)
}
else {
STRLEN len;
- uv = utf8_to_uvuni(s, &len);
+ uv = utf8n_to_uvuni(s, send - s, &len, UTF8_ALLOW_DEFAULT);
if (uv != puv) {
Move(s, d, len, U8);
d += len;