diff options
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -5004,7 +5004,34 @@ NULL sayNO; /* NOTREACHED */ #undef ST + case FOLDCHAR: + n = ARG(scan); + if (nextchr==n) { + locinput += UTF8SKIP(locinput); + } else { + /* This malarky is to handle LATIN SMALL LETTER SHARP S + properly. Sigh */ + if (0xDF==n && (UTF||do_utf8) && + toLOWER(locinput[0])=='s' && toLOWER(locinput[1])=='s') + { + locinput += 2; + } else if (do_utf8) { + U8 tmpbuf1[UTF8_MAXBYTES_CASE+1]; + STRLEN tmplen1; + U8 tmpbuf2[UTF8_MAXBYTES_CASE+1]; + STRLEN tmplen2; + to_uni_fold(n, tmpbuf1, &tmplen1); + to_utf8_fold(locinput, tmpbuf2, &tmplen2); + if (tmplen1!=tmplen2 || !strnEQ(tmpbuf1,tmpbuf2,tmplen1)) + sayNO; + else + locinput += UTF8SKIP(locinput); + } else + sayNO; + } + nextchr = UCHARAT(locinput); + break; case LNBREAK: if ((n=is_LNBREAK(locinput,do_utf8))) { locinput += n; |