summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 464ceaf9e3..d2e9c66358 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4065,10 +4065,16 @@ S_regrepeat(pTHX_ regnode *p, I32 max)
case CANY:
scan = loceol;
break;
- case EXACT: /* length of string is 1 */
- c = (U8)*STRING(p);
- while (scan < loceol && UCHARAT(scan) == c)
- scan++;
+ case EXACT:
+ if (do_utf8) {
+ c = (U8)*STRING(p);
+ while (scan < loceol && utf8_to_uvuni((U8*)scan, 0) == c)
+ scan += UTF8SKIP(scan);
+ } else { /* length of string is 1 */
+ c = (U8)*STRING(p);
+ while (scan < loceol && UCHARAT(scan) == c)
+ scan++;
+ }
break;
case EXACTF: /* length of string is 1 */
c = (U8)*STRING(p);