p = regwhite(p, RExC_end);
if (UTF && FOLD) {
/* Prime the casefolded buffer. */
- toFOLD_uni(ender, tmpbuf, &foldlen);
- /* Need to peek at the first character. */
- ender = utf8_to_uvchr(tmpbuf, 0);
+ ender = toFOLD_uni(ender, tmpbuf, &foldlen);
}
if (ISMULT2(p)) { /* Back off on ?+*. */
if (len)
goto got_it;
else {
uvchr_to_utf8(tmpbuf, c);
- to_utf8_fold(tmpbuf, foldbuf, &foldlen);
- f = utf8_to_uvchr(foldbuf, 0);
+ f = to_utf8_fold(tmpbuf, foldbuf, &foldlen);
if ( f != c
&& (f == c1 || f == c2)
&& (ln == foldlen ||
goto got_it;
else {
uvchr_to_utf8(tmpbuf, c);
- to_utf8_fold(tmpbuf, foldbuf, &foldlen);
- f = utf8_to_uvchr(foldbuf, 0);
+ f = to_utf8_fold(tmpbuf, foldbuf, &foldlen);
if ( f != c
&& (f == c1 || f == c2)
&& (ln == foldlen ||