diff --git a/src/search.c b/src/search.c
index 1db967d..b47d90b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4740,7 +4740,7 @@ find_pattern_in_path(ptr, dir, len, whole, skip_comments,
 			 * Isolate the file name.
 			 * Include the surrounding "" or <> if present.
 			 */
-			for (p = incl_regmatch.endp[0]; !vim_isfilec(*p); p++)
+			for (p = incl_regmatch.startp[0]; !vim_isfilec(*p); p++)
 			    ;
 			for (i = 0; vim_isfilec(p[i]); i++)
 			    ;
