summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-02 15:12:57 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-02 15:12:57 +0000
commitd07ddd77a31b1e57c2f358652e4f3f85d2e29ad4 (patch)
tree7013c4763e4deccb95dbf68591f81dcc612507cc /regexec.c
parent2da3dd1220db0c8e18e8bcc1b6c47f5f168dc6fc (diff)
downloadperl-d07ddd77a31b1e57c2f358652e4f3f85d2e29ad4.tar.gz
One more iteration of the ibcmp_utf8() interface,
hopefully this is a convergent iteration... p4raw-id: //depot/perl@14014
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/regexec.c b/regexec.c
index c189b14470..51b55f6979 100644
--- a/regexec.c
+++ b/regexec.c
@@ -980,14 +980,16 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
U8 tmpbuf [UTF8_MAXLEN+1];
U8 foldbuf[UTF8_MAXLEN_FOLD+1];
STRLEN len, foldlen;
+ char* se;
if (c1 == c2) {
while (s <= e) {
c = utf8_to_uvchr((U8*)s, &len);
if ( c == c1
&& (ln == len ||
- !ibcmp_utf8(s, (STRLEN)-1, do_utf8, 0,
- m, ln, UTF, 0))
+ ((se = e + 1) &&
+ !ibcmp_utf8(s, &se, 0, do_utf8,
+ m, 0 , ln, UTF)))
&& (norun || regtry(prog, s)) )
goto got_it;
else {
@@ -997,8 +999,9 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- (STRLEN)-1, do_utf8, 0,
- m, ln, UTF, 0))
+ 0, foldlen, do_utf8,
+ m,
+ 0, ln, UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
}
@@ -1022,8 +1025,9 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
if ( (c == c1 || c == c2)
&& (ln == len ||
- !ibcmp_utf8(s, (STRLEN)-1, do_utf8, 0,
- m, ln, UTF, 0))
+ ((se = e + 1) &&
+ !ibcmp_utf8(s, &se, 0, do_utf8,
+ m, 0, ln, UTF)))
&& (norun || regtry(prog, s)) )
goto got_it;
else {
@@ -1033,8 +1037,9 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- (STRLEN)-1, do_utf8, 0,
- m, ln, UTF, 0))
+ 0, foldlen, do_utf8,
+ m,
+ 0, ln, UTF))
&& (norun || regtry(prog, s)) )
goto got_it;
}
@@ -2336,20 +2341,17 @@ S_regmatch(pTHX_ regnode *prog)
s = STRING(scan);
ln = STR_LEN(scan);
- {
+ if (do_utf8 || UTF) {
+ /* Either target or the pattern are utf8. */
char *l = locinput;
- char *e = s + ln;
-
- if (do_utf8 || UTF) {
- /* Either target or the pattern are utf8. */
+ char *e = PL_regeol;
- if (ibcmp_utf8(s, e - s, TRUE, 0,
- l, (STRLEN)-1, TRUE, &l))
- sayNO;
- locinput = l;
- nextchr = UCHARAT(locinput);
- break;
- }
+ if (ibcmp_utf8(s, 0, ln, do_utf8,
+ l, &e, 0, UTF))
+ sayNO;
+ locinput = e;
+ nextchr = UCHARAT(locinput);
+ break;
}
/* Neither the target and the pattern are utf8. */