Unicode casefolding fixes.
[p5sagit/p5-mst-13.2.git] / regexec.c
index 35a0a6c..b7528e7 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4110,9 +4110,12 @@ S_reginclass(pTHX_ register regnode *n, register U8* p, register bool do_utf8)
                    match = TRUE;
                else if (flags & ANYOF_FOLD) {
                    STRLEN ulen;
-                   U8 tmpbuf[UTF8_MAXLEN_UCLC+1];
+                   U8 tmpbuf[UTF8_MAXLEN_FOLD+1];
 
-                   toLOWER_utf8(p, tmpbuf, &ulen);
+                   to_utf8_fold(p, tmpbuf, &ulen);
+                   if (swash_fetch(sw, tmpbuf, do_utf8))
+                       match = TRUE;
+                   to_utf8_upper(p, tmpbuf, &ulen);
                    if (swash_fetch(sw, tmpbuf, do_utf8))
                        match = TRUE;
                }