diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-30 20:04:32 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-30 20:04:32 +0000 |
commit | 254ba52af7d39101b8ee76681bf95a1a95ebd042 (patch) | |
tree | 151569cef510eeaa419754ff11c6e8297f3b1aaa /regexec.c | |
parent | d2ee51b61413d0946f6558ae280350393bbe9b35 (diff) | |
download | perl-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.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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; |