From 57adda1e901c0744b0e4d3e3db55c301081db4f8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Tue, 3 Aug 2010 22:11:29 +0200
Subject: [PATCH] Fix: With 'path' set to relative directory ":find" completion
 didn't work. (Nazri Ramliy)

---
 src/misc1.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/misc1.c b/src/misc1.c
index e564c5cec3..bcf4ce7f83 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9347,8 +9347,13 @@ expand_path_option(curdir, gap)
 		continue;
 	    STRMOVE(buf + curdir_len + 1, buf);
 	    STRCPY(buf, curdir);
-	    add_pathsep(buf);
-	    STRMOVE(buf + curdir_len, buf + curdir_len + 1);
+	    buf[curdir_len] = PATHSEP;
+	    /*
+	     * 'path' may have "./baz" as one of the items.
+	     * If curdir is "/foo/bar", p will end up being "/foo/bar/./baz".
+	     * Simplify it.
+	     */
+	    simplify_filename(buf);
 	}
 
 	if (ga_grow(gap, 1) == FAIL)
-- 
GitLab