]>
Commit | Line | Data |
---|---|---|
f84cdf93 | 1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.264 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.264 | |
11 | Problem: When the current directory name contains wildcard characters, such | |
12 | as "foo[with]bar", the tags file can't be found. (Jeremy | |
13 | Erickson) | |
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 | |
17 | ||
18 | ||
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 | |
21 | *************** | |
22 | *** 816,821 **** | |
23 | --- 816,822 ---- | |
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. */ | |
30 | ||
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 | |
33 | *************** | |
34 | *** 9119,9125 **** | |
35 | * all entries found with "matchname". */ | |
36 | if ((p[0] != '.' || starts_with_dot) | |
37 | && (matchname == NULL | |
38 | ! || vim_regexec(®match, p, (colnr_T)0))) | |
39 | { | |
40 | #ifdef WIN3264 | |
41 | STRCPY(s, p); | |
42 | --- 9119,9127 ---- | |
43 | * all entries found with "matchname". */ | |
44 | if ((p[0] != '.' || starts_with_dot) | |
45 | && (matchname == NULL | |
46 | ! || vim_regexec(®match, p, (colnr_T)0) | |
47 | ! || ((flags & EW_NOTWILD) | |
48 | ! && fnamencmp(path + (s - buf), p, e - s) == 0))) | |
49 | { | |
50 | #ifdef WIN3264 | |
51 | STRCPY(s, p); | |
52 | *************** | |
53 | *** 9323,9329 **** | |
54 | e = p; | |
55 | *e = NUL; | |
56 | ||
57 | ! /* now we have one wildcard component between "s" and "e" */ | |
58 | /* Remove backslashes between "wildoff" and the start of the wildcard | |
59 | * component. */ | |
60 | for (p = buf + wildoff; p < s; ++p) | |
61 | --- 9325,9331 ---- | |
62 | e = p; | |
63 | *e = NUL; | |
64 | ||
65 | ! /* Now we have one wildcard component between "s" and "e". */ | |
66 | /* Remove backslashes between "wildoff" and the start of the wildcard | |
67 | * component. */ | |
68 | for (p = buf + wildoff; p < s; ++p) | |
69 | *************** | |
70 | *** 9390,9396 **** | |
71 | if (dp == NULL) | |
72 | break; | |
73 | if ((dp->d_name[0] != '.' || starts_with_dot) | |
74 | ! && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)) | |
75 | { | |
76 | STRCPY(s, dp->d_name); | |
77 | len = STRLEN(buf); | |
78 | --- 9392,9400 ---- | |
79 | if (dp == NULL) | |
80 | break; | |
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))) | |
85 | { | |
86 | STRCPY(s, dp->d_name); | |
87 | len = STRLEN(buf); | |
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 | |
90 | *************** | |
91 | *** 4653,4661 **** | |
92 | { | |
93 | if (r_ptr[0] == '\\' && r_ptr[1] == ';') | |
94 | { | |
95 | ! /* overwrite the escape char, | |
96 | ! * use STRLEN(r_ptr) to move the trailing '\0' | |
97 | ! */ | |
98 | STRMOVE(r_ptr, r_ptr + 1); | |
99 | r_ptr++; | |
100 | } | |
101 | --- 4653,4660 ---- | |
102 | { | |
103 | if (r_ptr[0] == '\\' && r_ptr[1] == ';') | |
104 | { | |
105 | ! /* Overwrite the escape char, | |
106 | ! * use STRLEN(r_ptr) to move the trailing '\0'. */ | |
107 | STRMOVE(r_ptr, r_ptr + 1); | |
108 | r_ptr++; | |
109 | } | |
110 | *************** | |
111 | *** 4914,4923 **** | |
112 | stackp->ffs_filearray_size = 0; | |
113 | } | |
114 | else | |
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); | |
119 | ||
120 | stackp->ffs_filearray_cur = 0; | |
121 | stackp->ffs_stage = 0; | |
122 | --- 4913,4925 ---- | |
123 | stackp->ffs_filearray_size = 0; | |
124 | } | |
125 | else | |
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); | |
133 | ||
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 | |
138 | *************** | |
139 | *** 711,712 **** | |
140 | --- 711,714 ---- | |
141 | { /* Add new patch number below this line */ | |
142 | + /**/ | |
143 | + 264, | |
144 | /**/ | |
145 | ||
146 | -- | |
147 | CUSTOMER: You're not fooling anyone y'know. Look, isn't there something | |
148 | you can do? | |
149 | DEAD PERSON: I feel happy... I feel happy. | |
150 | [whop] | |
151 | CUSTOMER: Ah, thanks very much. | |
152 | MORTICIAN: Not at all. See you on Thursday. | |
153 | CUSTOMER: Right. | |
154 | The Quest for the Holy Grail (Monty Python) | |
155 | ||
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 /// |