Attached patch fixes a bug for the find completion when 'path'
has a relative directory entry, for example

  $ cd ~/src/vim/
  $ vim
  :set path=./**
  :find misc<Ctrl+D>     <--- does not work

nazri.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
From e58667ed2398533adaef6fc85b6ab17980e0e1d8 Mon Sep 17 00:00:00 2001
From: Nazri Ramliy <[email protected]>
Date: Tue, 3 Aug 2010 15:26:24 +0800
Subject: [PATCH] bugfix for find completion when expanding relative 'path' item

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

diff --git a/src/misc1.c b/src/misc1.c
index 6e988fa..8ec0aef 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)
-- 
1.7.2.1.6.g61bf12

Raspunde prin e-mail lui