comparison src/misc2.c @ 2521:d890c820722f vim73

Fix: 'suffixesadd' was used for finding tags file.
author Bram Moolenaar <bram@vim.org>
date Sun, 08 Aug 2010 18:17:52 +0200
parents 6768ebd0bc04
children d7ecfc8b784c
comparison
equal deleted inserted replaced
2520:6768ebd0bc04 2521:d890c820722f
4161 * Needed for upward search. 4161 * Needed for upward search.
4162 * ffsc_wc_path: the part of the given path containing wildcards 4162 * ffsc_wc_path: the part of the given path containing wildcards
4163 * ffsc_level: how many levels of dirs to search downwards 4163 * ffsc_level: how many levels of dirs to search downwards
4164 * ffsc_stopdirs_v: array of stop directories for upward search 4164 * ffsc_stopdirs_v: array of stop directories for upward search
4165 * ffsc_find_what: FINDFILE_BOTH, FINDFILE_DIR or FINDFILE_FILE 4165 * ffsc_find_what: FINDFILE_BOTH, FINDFILE_DIR or FINDFILE_FILE
4166 * ffsc_tagfile: searching for tags file, don't use 'suffixesadd'
4166 */ 4167 */
4167 typedef struct ff_search_ctx_T 4168 typedef struct ff_search_ctx_T
4168 { 4169 {
4169 ff_stack_T *ffsc_stack_ptr; 4170 ff_stack_T *ffsc_stack_ptr;
4170 ff_visited_list_hdr_T *ffsc_visited_list; 4171 ff_visited_list_hdr_T *ffsc_visited_list;
4178 char_u *ffsc_wc_path; 4179 char_u *ffsc_wc_path;
4179 int ffsc_level; 4180 int ffsc_level;
4180 char_u **ffsc_stopdirs_v; 4181 char_u **ffsc_stopdirs_v;
4181 #endif 4182 #endif
4182 int ffsc_find_what; 4183 int ffsc_find_what;
4184 int ffsc_tagfile;
4183 } ff_search_ctx_T; 4185 } ff_search_ctx_T;
4184 4186
4185 /* locally needed functions */ 4187 /* locally needed functions */
4186 #ifdef FEAT_PATH_EXTRA 4188 #ifdef FEAT_PATH_EXTRA
4187 static int ff_check_visited __ARGS((ff_visited_T **, char_u *, char_u *)); 4189 static int ff_check_visited __ARGS((ff_visited_T **, char_u *, char_u *));
4305 char_u *stopdirs UNUSED; 4307 char_u *stopdirs UNUSED;
4306 int level; 4308 int level;
4307 int free_visited; 4309 int free_visited;
4308 int find_what; 4310 int find_what;
4309 void *search_ctx_arg; 4311 void *search_ctx_arg;
4310 int tagfile; 4312 int tagfile; /* expanding names of tags files */
4311 char_u *rel_fname; /* file name to use for "." */ 4313 char_u *rel_fname; /* file name to use for "." */
4312 { 4314 {
4313 #ifdef FEAT_PATH_EXTRA 4315 #ifdef FEAT_PATH_EXTRA
4314 char_u *wc_part; 4316 char_u *wc_part;
4315 #endif 4317 #endif
4327 if (search_ctx == NULL) 4329 if (search_ctx == NULL)
4328 goto error_return; 4330 goto error_return;
4329 vim_memset(search_ctx, 0, sizeof(ff_search_ctx_T)); 4331 vim_memset(search_ctx, 0, sizeof(ff_search_ctx_T));
4330 } 4332 }
4331 search_ctx->ffsc_find_what = find_what; 4333 search_ctx->ffsc_find_what = find_what;
4334 search_ctx->ffsc_tagfile = tagfile;
4332 4335
4333 /* clear the search context, but NOT the visited lists */ 4336 /* clear the search context, but NOT the visited lists */
4334 ff_clear(search_ctx); 4337 ff_clear(search_ctx);
4335 4338
4336 /* clear visited list if wanted */ 4339 /* clear visited list if wanted */
4897 * Try without extra suffix and then with suffixes 4900 * Try without extra suffix and then with suffixes
4898 * from 'suffixesadd'. 4901 * from 'suffixesadd'.
4899 */ 4902 */
4900 #ifdef FEAT_SEARCHPATH 4903 #ifdef FEAT_SEARCHPATH
4901 len = (int)STRLEN(file_path); 4904 len = (int)STRLEN(file_path);
4902 suf = curbuf->b_p_sua; 4905 if (search_ctx->ffsc_tagfile)
4906 suf = (char_u *)"";
4907 else
4908 suf = curbuf->b_p_sua;
4903 for (;;) 4909 for (;;)
4904 #endif 4910 #endif
4905 { 4911 {
4906 /* if file exists and we didn't already find it */ 4912 /* if file exists and we didn't already find it */
4907 if ((path_with_url(file_path) 4913 if ((path_with_url(file_path)