summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 58d973a80f..93fadab584 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4478,8 +4478,11 @@ NULL
cur_eval->u.eval.close_paren == (U32)ST.me->flags)
goto fake_end;
- if ( ST.count < (ST.minmod ? ARG1(ST.me) : ARG2(ST.me)) )
- goto curlym_do_A; /* try to match another A */
+ {
+ I32 max = (ST.minmod ? ARG1(ST.me) : ARG2(ST.me));
+ if ( max == REG_INFTY || ST.count < max )
+ goto curlym_do_A; /* try to match another A */
+ }
goto curlym_do_B; /* try to match B */
case CURLYM_A_fail: /* just failed to match an A */