comparison 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
comparison
equal deleted inserted replaced
2983:16eb33130e94 2984:aa40bddeea9a
9117 #endif 9117 #endif
9118 /* Ignore entries starting with a dot, unless when asked for. Accept 9118 /* Ignore entries starting with a dot, unless when asked for. Accept
9119 * all entries found with "matchname". */ 9119 * all entries found with "matchname". */
9120 if ((p[0] != '.' || starts_with_dot) 9120 if ((p[0] != '.' || starts_with_dot)
9121 && (matchname == NULL 9121 && (matchname == NULL
9122 || vim_regexec(&regmatch, p, (colnr_T)0))) 9122 || vim_regexec(&regmatch, p, (colnr_T)0)
9123 || ((flags & EW_NOTWILD)
9124 && fnamencmp(path + (s - buf), p, e - s) == 0)))
9123 { 9125 {
9124 #ifdef WIN3264 9126 #ifdef WIN3264
9125 STRCPY(s, p); 9127 STRCPY(s, p);
9126 #else 9128 #else
9127 namelowcpy(s, p); 9129 namelowcpy(s, p);
9321 *p++ = *path_end++; 9323 *p++ = *path_end++;
9322 } 9324 }
9323 e = p; 9325 e = p;
9324 *e = NUL; 9326 *e = NUL;
9325 9327
9326 /* now we have one wildcard component between "s" and "e" */ 9328 /* Now we have one wildcard component between "s" and "e". */
9327 /* Remove backslashes between "wildoff" and the start of the wildcard 9329 /* Remove backslashes between "wildoff" and the start of the wildcard
9328 * component. */ 9330 * component. */
9329 for (p = buf + wildoff; p < s; ++p) 9331 for (p = buf + wildoff; p < s; ++p)
9330 if (rem_backslash(p)) 9332 if (rem_backslash(p))
9331 { 9333 {
9388 { 9390 {
9389 dp = readdir(dirp); 9391 dp = readdir(dirp);
9390 if (dp == NULL) 9392 if (dp == NULL)
9391 break; 9393 break;
9392 if ((dp->d_name[0] != '.' || starts_with_dot) 9394 if ((dp->d_name[0] != '.' || starts_with_dot)
9393 && vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0)) 9395 && (vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0)
9396 || ((flags & EW_NOTWILD)
9397 && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
9394 { 9398 {
9395 STRCPY(s, dp->d_name); 9399 STRCPY(s, dp->d_name);
9396 len = STRLEN(buf); 9400 len = STRLEN(buf);
9397 9401
9398 if (starstar && stardepth < 100) 9402 if (starstar && stardepth < 100)