There's no point in matching something more than once that doesn't
advance the parse, as long as there are no side effects beyond those
from the first match. Those could only happen in code blocks, which
this code doesn't have.
+ /* Here we have a quantifier, and have calculated 'min' and 'max'.
+ *
+ * Check and possibly adjust a zero width operand */
if (! (flags & (HASWIDTH|POSTPONED))) {
if (max > REG_INFTY/3) {
if (origparse[0] == '\\' && origparse[1] == 'K') {
if (! (flags & (HASWIDTH|POSTPONED))) {
if (max > REG_INFTY/3) {
if (origparse[0] == '\\' && origparse[1] == 'K') {
+
+ /* There's no point in trying to match something 0 length more than
+ * once except for extra side effects, which we don't have here since
+ * not POSTPONED */
+ if (max > 1) {
+ max = 1;
+ if (min > max) {
+ min = max;
+ }
+ }