patch 9.1.0605: internal error with fuzzy completion

Problem:  internal error with fuzzy completion
          (techntools)
Solution: only fuzzy complete the pattern after directory separator
          (glepnir)

fixes: #15287
closes: #15291

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/search.c b/src/search.c
index f7aab7b..c8f8736 100644
--- a/src/search.c
+++ b/src/search.c
@@ -5222,15 +5222,16 @@
     if (whole_line)
 	current_pos.lnum += dir;
 
+    if (buf == curbuf)
+        circly_end = *start_pos;
+    else
+    {
+        circly_end.lnum = buf->b_ml.ml_line_count;
+        circly_end.col = 0;
+        circly_end.coladd = 0;
+    }
+
     do {
-	if (buf == curbuf)
-	    circly_end = *start_pos;
-	else
-	{
-	    circly_end.lnum = buf->b_ml.ml_line_count;
-	    circly_end.col = 0;
-	    circly_end.coladd = 0;
-	}
 
 	// Check if looped around and back to start position
 	if (looped_around && EQUAL_POS(current_pos, circly_end))
@@ -5255,6 +5256,8 @@
 			*pos = current_pos;
 			break;
 		    }
+		    else if (looped_around && current_pos.lnum == circly_end.lnum)
+			break;
 		}
 		else
 		{