summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-30 20:04:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-30 20:04:32 +0000
commit254ba52af7d39101b8ee76681bf95a1a95ebd042 (patch)
tree151569cef510eeaa419754ff11c6e8297f3b1aaa /regexec.c
parentd2ee51b61413d0946f6558ae280350393bbe9b35 (diff)
downloadperl-254ba52af7d39101b8ee76681bf95a1a95ebd042.tar.gz
Fix all the C(ommon) case foldings as per CaseFold.txt.
p4raw-id: //depot/perl@13963
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/regexec.c b/regexec.c
index 7b459e2d45..3f1449dbb8 100644
--- a/regexec.c
+++ b/regexec.c
@@ -979,8 +979,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
while (s <= e) {
if ( utf8_to_uvchr((U8*)s, &len) == c1
&& (ln == len ||
- ibcmp_utf8(s, do_utf8, strend - s,
- m, UTF, ln))
+ ibcmp_utf8(s, do_utf8, (I32)(strend - s),
+ m, UTF, (I32)ln))
&& (norun || regtry(prog, s)) )
goto got_it;
s += len;
@@ -988,14 +988,21 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
}
else {
while (s <= e) {
+ U8 tmpbuf [UTF8_MAXLEN+1];
+ U8 foldbuf[UTF8_MAXLEN_FOLD+1];
+ STRLEN foldlen;
UV c = utf8_to_uvchr((U8*)s, &len);
+ UV f;
+
+ uvchr_to_utf8(tmpbuf, c);
+ f = to_utf8_fold(tmpbuf, foldbuf, &foldlen);
+
if (c == (UV)UNICODE_GREEK_CAPITAL_LETTER_SIGMA ||
c == (UV)UNICODE_GREEK_SMALL_LETTER_FINAL_SIGMA)
c = (UV)UNICODE_GREEK_SMALL_LETTER_SIGMA;
- if ( (c == c1 || c == c2)
- && (ln == len ||
- ibcmp_utf8(s, do_utf8, strend - s,
- m, UTF, ln))
+ if ( (c == c1 || c == c2 || f == c1 || f == c2)
+ && ibcmp_utf8(s, do_utf8, (I32)(strend - s),
+ m, UTF, (I32)ln)
&& (norun || regtry(prog, s)) )
goto got_it;
s += len;