diff src/fileio.c @ 2243:03a5f2897db3 vim73

Fix completion of file names with '%' and '*'.
author Bram Moolenaar <bram@vim.org>
date Tue, 01 Jun 2010 21:57:09 +0200
parents 60da25e3aab7
children caca0ddd789b
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -10189,6 +10189,13 @@ file_pat_to_reg_pat(pat, pat_end, allow_
 		    }
 		}
 #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_
 			)
 		    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)