updated for version 7.4.290
Problem: A non-greedy match followed by a branch is too greedy. (Ingo
Karkat)
Solution: Add NFA_MATCH when it is already in the state list if the position
differs.
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index d855df3..3873d9a 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4324,8 +4324,10 @@
{
/* This state is already in the list, don't add it again,
* unless it is an MOPEN that is used for a backreference or
- * when there is a PIM. */
- if (!nfa_has_backref && pim == NULL && !l->has_pim)
+ * when there is a PIM. For NFA_MATCH check the position,
+ * lower position is preferred. */
+ if (!nfa_has_backref && pim == NULL && !l->has_pim
+ && state->c != NFA_MATCH)
{
skip_add:
#ifdef ENABLE_LOG