summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-01 03:35:01 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-01 03:35:01 +0000
commitffce6cc29631cbe46068af7601780981e4969f2a (patch)
tree22070032294df853b24e3fa8835468d85a183fab /regexec.c
parent99f22665d16e539ac96fd8697c65cfa96010d82d (diff)
downloadperl-ffce6cc29631cbe46068af7601780981e4969f2a.tar.gz
Unnecessary/Lingering UTF8 flag might mess up caseless matching
(found by Jeffrey Friedl) p4raw-id: //depot/perl@13992
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 3aed549382..0f738d1b27 100644
--- a/regexec.c
+++ b/regexec.c
@@ -995,7 +995,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
c = utf8_to_uvchr((U8*)s, &len);
if ( c == c1
&& (ln == len ||
- !ibcmp_utf8(s, do_utf8, strend - s,
+ !ibcmp_utf8(s, do_utf8,
+ strend - s > ln ? ln : strend - s,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1007,7 +1008,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- do_utf8, foldlen,
+ do_utf8,
+ foldlen > ln ? ln : foldlen,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1032,7 +1034,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
if ( (c == c1 || c == c2)
&& (ln == len ||
- !ibcmp_utf8(s, do_utf8, strend - s,
+ !ibcmp_utf8(s, do_utf8,
+ strend - s > ln ? ln : strend - s,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1044,7 +1047,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- do_utf8, foldlen,
+ do_utf8,
+ foldlen > ln ? ln : foldlen,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;