]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.264 v7.3.264
authorBram Moolenaar <Bram@vim.org>
Wed, 27 Jul 2011 15:31:47 +0000 (17:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jul 2011 15:31:47 +0000 (17:31 +0200)
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.

src/misc1.c
src/misc2.c
src/version.c
src/vim.h

index a573b3b999d0258411979be8b2cafe7a95aa45ad..a3a20597be261a2d67add70b7020058dafdbecd6 100644 (file)
@@ -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);
index dfb1fc487fafe41226c8c2ac01d69d08b708d69f..f91a64aced12c6780f6f3d2a8a6a81744f70873a 100644 (file)
@@ -4653,9 +4653,8 @@ vim_findfile_stopdir(buf)
     {
        if (r_ptr[0] == '\\' && r_ptr[1] == ';')
        {
-           /* overwrite the escape char,
-            * use STRLEN(r_ptr) to move the trailing '\0'
-            */
+           /* Overwrite the escape char,
+            * use STRLEN(r_ptr) to move the trailing '\0'. */
            STRMOVE(r_ptr, r_ptr + 1);
            r_ptr++;
        }
@@ -4914,10 +4913,13 @@ vim_findfile(search_ctx_arg)
                        stackp->ffs_filearray_size = 0;
                }
                else
+                   /* Add EW_NOTWILD because the expanded path may contain
+                    * wildcard characters that are to be taken literally.
+                    * This is a bit of a hack. */
                    expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
                            &stackp->ffs_filearray_size,
                            &stackp->ffs_filearray,
-                           EW_DIR|EW_ADDSLASH|EW_SILENT);
+                           EW_DIR|EW_ADDSLASH|EW_SILENT|EW_NOTWILD);
 
                stackp->ffs_filearray_cur = 0;
                stackp->ffs_stage = 0;
index fc51557365525f04e0d82e8bc905a9c688230d71..dbd76b35483125ef68687b561d162cf232b679fc 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    264,
 /**/
     263,
 /**/
index a1a970819115b0efe3aa2a740997a95edf4c83b4..127387aa0d6e83d79ff33c50bba136a01dbf1ec2 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -816,6 +816,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define EW_PATH                0x80    /* search in 'path' too */
 #define EW_ICASE       0x100   /* ignore case */
 #define EW_NOERROR     0x200   /* no error for bad regexp */
+#define EW_NOTWILD     0x400   /* add match with literal name if exists */
 /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
  * is used when executing commands and EW_SILENT for interactive expanding. */