summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-07-27 17:31:47 +0200
committerBram Moolenaar <Bram@vim.org>2011-07-27 17:31:47 +0200
commit0b573a58e63f43f462e6824080c633bbd1a8a5dd (patch)
tree12c949bd62bf37417834b51a1fd26c0c05d838f7 /src/misc1.c
parenta171162356bd7f8b11f9af1061591316fc8dad3d (diff)
downloadvim-git-0b573a58e63f43f462e6824080c633bbd1a8a5dd.tar.gz
updated for version 7.3.264v7.3.264
Problem: When the current directory name contains wildcard characters, such as "foo[with]bar", the tags file can't be found. (Jeremy Erickson) Solution: When searching for matching files also match without expanding wildcards. This is a bit of a hack.
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/misc1.c b/src/misc1.c
index a573b3b99..a3a20597b 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9119,7 +9119,9 @@ dos_expandpath(
* all entries found with "matchname". */
if ((p[0] != '.' || starts_with_dot)
&& (matchname == NULL
- || vim_regexec(&regmatch, p, (colnr_T)0)))
+ || vim_regexec(&regmatch, p, (colnr_T)0)
+ || ((flags & EW_NOTWILD)
+ && fnamencmp(path + (s - buf), p, e - s) == 0)))
{
#ifdef WIN3264
STRCPY(s, p);
@@ -9323,7 +9325,7 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
e = p;
*e = NUL;
- /* now we have one wildcard component between "s" and "e" */
+ /* Now we have one wildcard component between "s" and "e". */
/* Remove backslashes between "wildoff" and the start of the wildcard
* component. */
for (p = buf + wildoff; p < s; ++p)
@@ -9390,7 +9392,9 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
if (dp == NULL)
break;
if ((dp->d_name[0] != '.' || starts_with_dot)
- && vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0))
+ && (vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0)
+ || ((flags & EW_NOTWILD)
+ && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
{
STRCPY(s, dp->d_name);
len = STRLEN(buf);