summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Make_mvc.mak2
-rw-r--r--src/ex_getln.c12
-rw-r--r--src/fileio.c11
3 files changed, 21 insertions, 4 deletions
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 5a123a8d9a..14c46ed52d 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -208,7 +208,7 @@ MAKEFLAGS_GVIMEXT = DEBUG=yes
!include <Win32.mak>
-# May turn on Win64 compatibility warnings for VC7.x and VC8.
+# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
WP64CHECK = /Wp64
#>>>>> path of the compiler and linker; name of include and lib directories
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6e74a23f1a..e8b6f7c4d1 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4091,6 +4091,7 @@ addstar(fname, len, context)
int i, j;
int new_len;
char_u *tail;
+ int ends_in_star;
if (context != EXPAND_FILES
&& context != EXPAND_SHELLCMD
@@ -4181,8 +4182,17 @@ addstar(fname, len, context)
* When the name ends in '$' don't add a star, remove the '$'.
*/
tail = gettail(retval);
+ ends_in_star = (len > 0 && retval[len - 1] == '*');
+#ifndef BACKSLASH_IN_FILENAME
+ for (i = len - 2; i >= 0; --i)
+ {
+ if (retval[i] != '\\')
+ break;
+ ends_in_star = !ends_in_star;
+ }
+#endif
if ((*retval != '~' || tail != retval)
- && (len == 0 || retval[len - 1] != '*')
+ && !ends_in_star
&& vim_strchr(tail, '$') == NULL
&& vim_strchr(retval, '`') == NULL)
retval[len++] = '*';
diff --git a/src/fileio.c b/src/fileio.c
index 2685101170..4a9a7f10e1 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)