Mercurial > vim
diff src/misc1.c @ 2984:aa40bddeea9a v7.3.264
updated for version 7.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.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 27 Jul 2011 17:31:47 +0200 |
parents | aa998de9f959 |
children | 4a7097153089 |
line wrap: on
line diff
--- 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(®match, p, (colnr_T)0))) + || vim_regexec(®match, 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, flag 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, flag if (dp == NULL) break; if ((dp->d_name[0] != '.' || starts_with_dot) - && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)) + && (vim_regexec(®match, (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);