summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-06-01 21:57:09 +0200
committerBram Moolenaar <Bram@vim.org>2010-06-01 21:57:09 +0200
commit8cd213c09a3598834888d81deb45ff17e6654a86 (patch)
tree867353b3474346210f6de33ad2b5b01936a4460d /src/fileio.c
parent83d09bb85e471135222f79b15de549f435e73fae (diff)
downloadvim-git-8cd213c09a3598834888d81deb45ff17e6654a86.tar.gz
Fix completion of file names with '%' and '*'.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 268510117..4a9a7f10e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -10189,6 +10189,13 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
}
}
#endif
+ /* Undo escaping from ExpandEscape():
+ * foo\?bar -> foo?bar
+ * foo\%bar -> foo%bar
+ * foo\,bar -> foo,bar
+ * foo\ bar -> foo bar
+ * Don't unescape \, * and others that are also special in a
+ * regexp. */
if (*++p == '?'
#ifdef BACKSLASH_IN_FILENAME
&& no_bslash
@@ -10196,8 +10203,8 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
)
reg_pat[i++] = '?';
else
- if (*p == ',')
- reg_pat[i++] = ',';
+ if (*p == ',' || *p == '%' || *p == '#' || *p == ' ')
+ reg_pat[i++] = *p;
else
{
if (allow_dirs != NULL && vim_ispathsep(*p)