1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When the current directory name contains wildcard characters, such
12 as "foo[with]bar", the tags file can't be found. (Jeremy
14 Solution: When searching for matching files also match without expanding
15 wildcards. This is a bit of a hack.
16 Files: src/vim.h, src/misc1.c, src/misc2.c
19 *** ../vim-7.3.263/src/vim.h 2011-07-20 15:04:52.000000000 +0200
20 --- src/vim.h 2011-07-27 16:21:38.000000000 +0200
24 #define EW_PATH 0x80 /* search in 'path' too */
25 #define EW_ICASE 0x100 /* ignore case */
26 #define EW_NOERROR 0x200 /* no error for bad regexp */
27 + #define EW_NOTWILD 0x400 /* add match with literal name if exists */
28 /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
29 * is used when executing commands and EW_SILENT for interactive expanding. */
31 *** ../vim-7.3.263/src/misc1.c 2011-07-20 15:04:52.000000000 +0200
32 --- src/misc1.c 2011-07-27 17:24:39.000000000 +0200
35 * all entries found with "matchname". */
36 if ((p[0] != '.' || starts_with_dot)
38 ! || vim_regexec(®match, p, (colnr_T)0)))
43 * all entries found with "matchname". */
44 if ((p[0] != '.' || starts_with_dot)
46 ! || vim_regexec(®match, p, (colnr_T)0)
47 ! || ((flags & EW_NOTWILD)
48 ! && fnamencmp(path + (s - buf), p, e - s) == 0)))
57 ! /* now we have one wildcard component between "s" and "e" */
58 /* Remove backslashes between "wildoff" and the start of the wildcard
60 for (p = buf + wildoff; p < s; ++p)
65 ! /* Now we have one wildcard component between "s" and "e". */
66 /* Remove backslashes between "wildoff" and the start of the wildcard
68 for (p = buf + wildoff; p < s; ++p)
73 if ((dp->d_name[0] != '.' || starts_with_dot)
74 ! && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0))
76 STRCPY(s, dp->d_name);
81 if ((dp->d_name[0] != '.' || starts_with_dot)
82 ! && (vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)
83 ! || ((flags & EW_NOTWILD)
84 ! && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
86 STRCPY(s, dp->d_name);
88 *** ../vim-7.3.263/src/misc2.c 2011-07-07 17:15:29.000000000 +0200
89 --- src/misc2.c 2011-07-27 17:21:10.000000000 +0200
93 if (r_ptr[0] == '\\' && r_ptr[1] == ';')
95 ! /* overwrite the escape char,
96 ! * use STRLEN(r_ptr) to move the trailing '\0'
98 STRMOVE(r_ptr, r_ptr + 1);
103 if (r_ptr[0] == '\\' && r_ptr[1] == ';')
105 ! /* Overwrite the escape char,
106 ! * use STRLEN(r_ptr) to move the trailing '\0'. */
107 STRMOVE(r_ptr, r_ptr + 1);
112 stackp->ffs_filearray_size = 0;
115 expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
116 &stackp->ffs_filearray_size,
117 &stackp->ffs_filearray,
118 ! EW_DIR|EW_ADDSLASH|EW_SILENT);
120 stackp->ffs_filearray_cur = 0;
121 stackp->ffs_stage = 0;
123 stackp->ffs_filearray_size = 0;
126 + /* Add EW_NOTWILD because the expanded path may contain
127 + * wildcard characters that are to be taken literally.
128 + * This is a bit of a hack. */
129 expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
130 &stackp->ffs_filearray_size,
131 &stackp->ffs_filearray,
132 ! EW_DIR|EW_ADDSLASH|EW_SILENT|EW_NOTWILD);
134 stackp->ffs_filearray_cur = 0;
135 stackp->ffs_stage = 0;
136 *** ../vim-7.3.263/src/version.c 2011-07-27 14:15:41.000000000 +0200
137 --- src/version.c 2011-07-27 17:25:44.000000000 +0200
141 { /* Add new patch number below this line */
147 CUSTOMER: You're not fooling anyone y'know. Look, isn't there something
149 DEAD PERSON: I feel happy... I feel happy.
151 CUSTOMER: Ah, thanks very much.
152 MORTICIAN: Not at all. See you on Thursday.
154 The Quest for the Holy Grail (Monty Python)
156 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
157 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
158 \\\ an exciting new programming language -- http://www.Zimbu.org ///
159 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///