patch 9.0.1233: search() loops forever if "skip" is TRUE for all matches
Problem: search() loops forever if "skip" is TRUE for all matches.
Solution: Keep the position of the first match.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 5b25e97..7b34e39 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -8794,7 +8794,8 @@
if (subpatnum == FAIL || !use_skip)
// didn't find it or no skip argument
break;
- firstpos = pos;
+ if (firstpos.lnum == 0)
+ firstpos = pos;
// If the skip expression matches, ignore this match.
{