mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.0270: some values of 'path' and 'tags' invalid in the tiny version
Problem: Some values of 'path' and 'tags' do not work in the tiny version. Solution: Graduate the +path_extra feature.
This commit is contained in:
@@ -1703,8 +1703,6 @@ problem goes away the next day.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
11. File Searching *file-searching*
|
11. File Searching *file-searching*
|
||||||
|
|
||||||
{not available when compiled without the |+path_extra| feature}
|
|
||||||
|
|
||||||
The file searching is currently used for the 'path', 'cdpath' and 'tags'
|
The file searching is currently used for the 'path', 'cdpath' and 'tags'
|
||||||
options, for |finddir()| and |findfile()|. Other commands use |wildcards|
|
options, for |finddir()| and |findfile()|. Other commands use |wildcards|
|
||||||
which is slightly different.
|
which is slightly different.
|
||||||
|
@@ -5949,7 +5949,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
"http://www.vim.org" will make ":find index.html" work.
|
"http://www.vim.org" will make ":find index.html" work.
|
||||||
- Search upwards and downwards in a directory tree using "*", "**" and
|
- Search upwards and downwards in a directory tree using "*", "**" and
|
||||||
";". See |file-searching| for info and syntax.
|
";". See |file-searching| for info and syntax.
|
||||||
{not available when compiled without the |+path_extra| feature}
|
|
||||||
- Careful with '\' characters, type two to get one in the option: >
|
- Careful with '\' characters, type two to get one in the option: >
|
||||||
:set path=.,c:\\include
|
:set path=.,c:\\include
|
||||||
< Or just use '/' instead: >
|
< Or just use '/' instead: >
|
||||||
@@ -8001,8 +8000,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
a directory tree. See |file-searching|. E.g., "/lib/**/tags" will
|
a directory tree. See |file-searching|. E.g., "/lib/**/tags" will
|
||||||
find all files named "tags" below "/lib". The filename itself cannot
|
find all files named "tags" below "/lib". The filename itself cannot
|
||||||
contain wildcards, it is used as-is. E.g., "/lib/**/tags?" will find
|
contain wildcards, it is used as-is. E.g., "/lib/**/tags?" will find
|
||||||
files called "tags?". {not available when compiled without the
|
files called "tags?".
|
||||||
|+path_extra| feature}
|
|
||||||
The |tagfiles()| function can be used to get a list of the file names
|
The |tagfiles()| function can be used to get a list of the file names
|
||||||
actually used.
|
actually used.
|
||||||
If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
|
If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
|
||||||
|
@@ -432,7 +432,8 @@ T *+num64* 64-bit Number support |Number|
|
|||||||
check the actual size of a Number.
|
check the actual size of a Number.
|
||||||
m *+ole* Win32 GUI only: |ole-interface|
|
m *+ole* Win32 GUI only: |ole-interface|
|
||||||
N *+packages* Loading |packages|
|
N *+packages* Loading |packages|
|
||||||
N *+path_extra* Up/downwards search in 'path' and 'tags'
|
T *+path_extra* Up/downwards search in 'path' and 'tags' Always
|
||||||
|
enabled since 9.0.0270
|
||||||
m *+perl* Perl interface |perl|
|
m *+perl* Perl interface |perl|
|
||||||
m *+perl/dyn* Perl interface |perl-dynamic| |/dyn|
|
m *+perl/dyn* Perl interface |perl-dynamic| |/dyn|
|
||||||
N *+persistent_undo* Persistent undo |undo-persistence|
|
N *+persistent_undo* Persistent undo |undo-persistence|
|
||||||
|
@@ -849,10 +849,8 @@ EXTERN char e_internal_error_lalloc_zero[]
|
|||||||
INIT(= N_("E341: Internal error: lalloc(0, )"));
|
INIT(= N_("E341: Internal error: lalloc(0, )"));
|
||||||
EXTERN char e_out_of_memory_allocating_nr_bytes[]
|
EXTERN char e_out_of_memory_allocating_nr_bytes[]
|
||||||
INIT(= N_("E342: Out of memory! (allocating %lu bytes)"));
|
INIT(= N_("E342: Out of memory! (allocating %lu bytes)"));
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
EXTERN char e_invalid_path_number_must_be_at_end_of_path_or_be_followed_by_str[]
|
EXTERN char e_invalid_path_number_must_be_at_end_of_path_or_be_followed_by_str[]
|
||||||
INIT(= N_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."));
|
INIT(= N_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."));
|
||||||
#endif
|
|
||||||
EXTERN char e_cant_find_directory_str_in_cdpath[]
|
EXTERN char e_cant_find_directory_str_in_cdpath[]
|
||||||
INIT(= N_("E344: Can't find directory \"%s\" in cdpath"));
|
INIT(= N_("E344: Can't find directory \"%s\" in cdpath"));
|
||||||
EXTERN char e_cant_find_file_str_in_path[]
|
EXTERN char e_cant_find_file_str_in_path[]
|
||||||
|
@@ -5954,13 +5954,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
0
|
0
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
{"path_extra",
|
{"path_extra", 1},
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
1
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
},
|
|
||||||
{"perl",
|
{"perl",
|
||||||
#if defined(FEAT_PERL) && !defined(DYNAMIC_PERL)
|
#if defined(FEAT_PERL) && !defined(DYNAMIC_PERL)
|
||||||
1
|
1
|
||||||
|
@@ -117,6 +117,7 @@
|
|||||||
* +smartindent smart C code indenting when the 'si' option is set.
|
* +smartindent smart C code indenting when the 'si' option is set.
|
||||||
* +textobjects Text objects: "vaw", "das", etc.
|
* +textobjects Text objects: "vaw", "das", etc.
|
||||||
* +file_in_path "gf" and "<cfile>" commands.
|
* +file_in_path "gf" and "<cfile>" commands.
|
||||||
|
* +path_extra up/downwards searching in 'path' and 'tags'.
|
||||||
*
|
*
|
||||||
* Obsolete:
|
* Obsolete:
|
||||||
* +tag_old_static Old style static tags: "file:tag file ..".
|
* +tag_old_static Old style static tags: "file:tag file ..".
|
||||||
@@ -210,13 +211,6 @@
|
|||||||
# define FEAT_FIND_ID
|
# define FEAT_FIND_ID
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* +path_extra up/downwards searching in 'path' and 'tags'.
|
|
||||||
*/
|
|
||||||
#ifdef FEAT_NORMAL
|
|
||||||
# define FEAT_PATH_EXTRA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* +rightleft Right-to-left editing/typing support.
|
* +rightleft Right-to-left editing/typing support.
|
||||||
*/
|
*/
|
||||||
|
113
src/findfile.c
113
src/findfile.c
@@ -67,9 +67,7 @@ typedef struct ff_stack
|
|||||||
// the fix part (no wildcards) and the part containing the wildcards
|
// the fix part (no wildcards) and the part containing the wildcards
|
||||||
// of the search path
|
// of the search path
|
||||||
char_u *ffs_fix_path;
|
char_u *ffs_fix_path;
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
char_u *ffs_wc_path;
|
char_u *ffs_wc_path;
|
||||||
#endif
|
|
||||||
|
|
||||||
// files/dirs found in the above directory, matched by the first wildcard
|
// files/dirs found in the above directory, matched by the first wildcard
|
||||||
// of wc_part
|
// of wc_part
|
||||||
@@ -97,11 +95,10 @@ typedef struct ff_visited
|
|||||||
{
|
{
|
||||||
struct ff_visited *ffv_next;
|
struct ff_visited *ffv_next;
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
// Visited directories are different if the wildcard string are
|
// Visited directories are different if the wildcard string are
|
||||||
// different. So we have to save it.
|
// different. So we have to save it.
|
||||||
char_u *ffv_wc_path;
|
char_u *ffv_wc_path;
|
||||||
#endif
|
|
||||||
// for unix use inode etc for comparison (needed because of links), else
|
// for unix use inode etc for comparison (needed because of links), else
|
||||||
// use filename.
|
// use filename.
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
@@ -173,21 +170,15 @@ typedef struct ff_search_ctx_T
|
|||||||
char_u *ffsc_file_to_search;
|
char_u *ffsc_file_to_search;
|
||||||
char_u *ffsc_start_dir;
|
char_u *ffsc_start_dir;
|
||||||
char_u *ffsc_fix_path;
|
char_u *ffsc_fix_path;
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
char_u *ffsc_wc_path;
|
char_u *ffsc_wc_path;
|
||||||
int ffsc_level;
|
int ffsc_level;
|
||||||
char_u **ffsc_stopdirs_v;
|
char_u **ffsc_stopdirs_v;
|
||||||
#endif
|
|
||||||
int ffsc_find_what;
|
int ffsc_find_what;
|
||||||
int ffsc_tagfile;
|
int ffsc_tagfile;
|
||||||
} ff_search_ctx_T;
|
} ff_search_ctx_T;
|
||||||
|
|
||||||
// locally needed functions
|
// locally needed functions
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
static int ff_check_visited(ff_visited_T **, char_u *, char_u *);
|
static int ff_check_visited(ff_visited_T **, char_u *, char_u *);
|
||||||
#else
|
|
||||||
static int ff_check_visited(ff_visited_T **, char_u *);
|
|
||||||
#endif
|
|
||||||
static void vim_findfile_free_visited(void *search_ctx_arg);
|
static void vim_findfile_free_visited(void *search_ctx_arg);
|
||||||
static void vim_findfile_free_visited_list(ff_visited_list_hdr_T **list_headp);
|
static void vim_findfile_free_visited_list(ff_visited_list_hdr_T **list_headp);
|
||||||
static void ff_free_visited_list(ff_visited_T *vl);
|
static void ff_free_visited_list(ff_visited_T *vl);
|
||||||
@@ -197,14 +188,8 @@ static void ff_push(ff_search_ctx_T *search_ctx, ff_stack_T *stack_ptr);
|
|||||||
static ff_stack_T *ff_pop(ff_search_ctx_T *search_ctx);
|
static ff_stack_T *ff_pop(ff_search_ctx_T *search_ctx);
|
||||||
static void ff_clear(ff_search_ctx_T *search_ctx);
|
static void ff_clear(ff_search_ctx_T *search_ctx);
|
||||||
static void ff_free_stack_element(ff_stack_T *stack_ptr);
|
static void ff_free_stack_element(ff_stack_T *stack_ptr);
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
static ff_stack_T *ff_create_stack_element(char_u *, char_u *, int, int);
|
static ff_stack_T *ff_create_stack_element(char_u *, char_u *, int, int);
|
||||||
#else
|
|
||||||
static ff_stack_T *ff_create_stack_element(char_u *, int, int);
|
|
||||||
#endif
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
static int ff_path_in_stoplist(char_u *, int, char_u **);
|
static int ff_path_in_stoplist(char_u *, int, char_u **);
|
||||||
#endif
|
|
||||||
|
|
||||||
static char_u *ff_expand_buffer = NULL; // used for expanding filenames
|
static char_u *ff_expand_buffer = NULL; // used for expanding filenames
|
||||||
|
|
||||||
@@ -306,9 +291,7 @@ vim_findfile_init(
|
|||||||
int tagfile, // expanding names of tags files
|
int tagfile, // expanding names of tags files
|
||||||
char_u *rel_fname) // file name to use for "."
|
char_u *rel_fname) // file name to use for "."
|
||||||
{
|
{
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
char_u *wc_part;
|
char_u *wc_part;
|
||||||
#endif
|
|
||||||
ff_stack_T *sptr;
|
ff_stack_T *sptr;
|
||||||
ff_search_ctx_T *search_ctx;
|
ff_search_ctx_T *search_ctx;
|
||||||
|
|
||||||
@@ -409,7 +392,6 @@ vim_findfile_init(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
/*
|
/*
|
||||||
* If stopdirs are given, split them into an array of pointers.
|
* If stopdirs are given, split them into an array of pointers.
|
||||||
* If this fails (mem allocation), there is no upward search at all or a
|
* If this fails (mem allocation), there is no upward search at all or a
|
||||||
@@ -464,9 +446,7 @@ vim_findfile_init(
|
|||||||
search_ctx->ffsc_stopdirs_v[dircount-1] = NULL;
|
search_ctx->ffsc_stopdirs_v[dircount-1] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
search_ctx->ffsc_level = level;
|
search_ctx->ffsc_level = level;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -531,7 +511,6 @@ vim_findfile_init(
|
|||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
search_ctx->ffsc_fix_path = vim_strsave(path);
|
search_ctx->ffsc_fix_path = vim_strsave(path);
|
||||||
|
|
||||||
if (search_ctx->ffsc_start_dir == NULL)
|
if (search_ctx->ffsc_start_dir == NULL)
|
||||||
@@ -565,7 +544,6 @@ vim_findfile_init(
|
|||||||
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
|
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
|
||||||
add_pathsep(ff_expand_buffer);
|
add_pathsep(ff_expand_buffer);
|
||||||
}
|
}
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char_u *p = gettail(search_ctx->ffsc_fix_path);
|
char_u *p = gettail(search_ctx->ffsc_fix_path);
|
||||||
@@ -612,15 +590,11 @@ vim_findfile_init(
|
|||||||
search_ctx->ffsc_wc_path = temp;
|
search_ctx->ffsc_wc_path = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
vim_free(buf);
|
vim_free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
sptr = ff_create_stack_element(ff_expand_buffer,
|
sptr = ff_create_stack_element(ff_expand_buffer,
|
||||||
#ifdef FEAT_PATH_EXTRA
|
search_ctx->ffsc_wc_path, level, 0);
|
||||||
search_ctx->ffsc_wc_path,
|
|
||||||
#endif
|
|
||||||
level, 0);
|
|
||||||
|
|
||||||
if (sptr == NULL)
|
if (sptr == NULL)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
@@ -643,7 +617,6 @@ error_return:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_PATH_EXTRA) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Get the stopdir string. Check that ';' is not escaped.
|
* Get the stopdir string. Check that ';' is not escaped.
|
||||||
*/
|
*/
|
||||||
@@ -672,7 +645,6 @@ vim_findfile_stopdir(char_u *buf)
|
|||||||
r_ptr = NULL;
|
r_ptr = NULL;
|
||||||
return r_ptr;
|
return r_ptr;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clean up the given search context. Can handle a NULL pointer.
|
* Clean up the given search context. Can handle a NULL pointer.
|
||||||
@@ -704,10 +676,8 @@ vim_findfile_cleanup(void *ctx)
|
|||||||
vim_findfile(void *search_ctx_arg)
|
vim_findfile(void *search_ctx_arg)
|
||||||
{
|
{
|
||||||
char_u *file_path;
|
char_u *file_path;
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
char_u *rest_of_wildcards;
|
char_u *rest_of_wildcards;
|
||||||
char_u *path_end = NULL;
|
char_u *path_end = NULL;
|
||||||
#endif
|
|
||||||
ff_stack_T *stackp;
|
ff_stack_T *stackp;
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
@@ -727,18 +697,14 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
if ((file_path = alloc(MAXPATHL)) == NULL)
|
if ((file_path = alloc(MAXPATHL)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
// store the end of the start dir -- needed for upward search
|
// store the end of the start dir -- needed for upward search
|
||||||
if (search_ctx->ffsc_start_dir != NULL)
|
if (search_ctx->ffsc_start_dir != NULL)
|
||||||
path_end = &search_ctx->ffsc_start_dir[
|
path_end = &search_ctx->ffsc_start_dir[
|
||||||
STRLEN(search_ctx->ffsc_start_dir)];
|
STRLEN(search_ctx->ffsc_start_dir)];
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
// upward search loop
|
// upward search loop
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
// downward search loop
|
// downward search loop
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -774,11 +740,7 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
if (stackp->ffs_filearray == NULL
|
if (stackp->ffs_filearray == NULL
|
||||||
&& ff_check_visited(&search_ctx->ffsc_dir_visited_list
|
&& ff_check_visited(&search_ctx->ffsc_dir_visited_list
|
||||||
->ffvl_visited_list,
|
->ffvl_visited_list,
|
||||||
stackp->ffs_fix_path
|
stackp->ffs_fix_path, stackp->ffs_wc_path) == FAIL)
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
, stackp->ffs_wc_path
|
|
||||||
#endif
|
|
||||||
) == FAIL)
|
|
||||||
{
|
{
|
||||||
#ifdef FF_VERBOSE
|
#ifdef FF_VERBOSE
|
||||||
if (p_verbose >= 5)
|
if (p_verbose >= 5)
|
||||||
@@ -859,7 +821,6 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
rest_of_wildcards = stackp->ffs_wc_path;
|
rest_of_wildcards = stackp->ffs_wc_path;
|
||||||
if (*rest_of_wildcards != NUL)
|
if (*rest_of_wildcards != NUL)
|
||||||
{
|
{
|
||||||
@@ -919,7 +880,6 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
if (vim_ispathsep(*rest_of_wildcards))
|
if (vim_ispathsep(*rest_of_wildcards))
|
||||||
rest_of_wildcards++;
|
rest_of_wildcards++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expand wildcards like "*" and "$VAR".
|
* Expand wildcards like "*" and "$VAR".
|
||||||
@@ -947,18 +907,14 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
stackp->ffs_filearray_cur = 0;
|
stackp->ffs_filearray_cur = 0;
|
||||||
stackp->ffs_stage = 0;
|
stackp->ffs_stage = 0;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
else
|
else
|
||||||
rest_of_wildcards = &stackp->ffs_wc_path[
|
rest_of_wildcards = &stackp->ffs_wc_path[
|
||||||
STRLEN(stackp->ffs_wc_path)];
|
STRLEN(stackp->ffs_wc_path)];
|
||||||
#endif
|
|
||||||
|
|
||||||
if (stackp->ffs_stage == 0)
|
if (stackp->ffs_stage == 0)
|
||||||
{
|
{
|
||||||
// this is the first time we work on this directory
|
// this is the first time we work on this directory
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
if (*rest_of_wildcards == NUL)
|
if (*rest_of_wildcards == NUL)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We don't have further wildcards to expand, so we have to
|
* We don't have further wildcards to expand, so we have to
|
||||||
@@ -1008,23 +964,17 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
== mch_isdir(file_path)))))
|
== mch_isdir(file_path)))))
|
||||||
#ifndef FF_VERBOSE
|
#ifndef FF_VERBOSE
|
||||||
&& (ff_check_visited(
|
&& (ff_check_visited(
|
||||||
&search_ctx->ffsc_visited_list->ffvl_visited_list,
|
&search_ctx->ffsc_visited_list
|
||||||
file_path
|
->ffvl_visited_list,
|
||||||
#ifdef FEAT_PATH_EXTRA
|
file_path, (char_u *)"") == OK)
|
||||||
, (char_u *)""
|
|
||||||
#endif
|
|
||||||
) == OK)
|
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef FF_VERBOSE
|
#ifdef FF_VERBOSE
|
||||||
if (ff_check_visited(
|
if (ff_check_visited(
|
||||||
&search_ctx->ffsc_visited_list->ffvl_visited_list,
|
&search_ctx->ffsc_visited_list
|
||||||
file_path
|
->ffvl_visited_list,
|
||||||
#ifdef FEAT_PATH_EXTRA
|
file_path, (char_u *)"") == FAIL)
|
||||||
, (char_u *)""
|
|
||||||
#endif
|
|
||||||
) == FAIL)
|
|
||||||
{
|
{
|
||||||
if (p_verbose >= 5)
|
if (p_verbose >= 5)
|
||||||
{
|
{
|
||||||
@@ -1074,7 +1024,6 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -1094,12 +1043,10 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
stackp->ffs_level - 1, 0));
|
stackp->ffs_level - 1, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
stackp->ffs_filearray_cur = 0;
|
stackp->ffs_filearray_cur = 0;
|
||||||
stackp->ffs_stage = 1;
|
stackp->ffs_stage = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
/*
|
/*
|
||||||
* if wildcards contains '**' we have to descent till we reach the
|
* if wildcards contains '**' we have to descent till we reach the
|
||||||
* leaves of the directory tree.
|
* leaves of the directory tree.
|
||||||
@@ -1119,14 +1066,12 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
stackp->ffs_wc_path, stackp->ffs_level - 1, 1));
|
stackp->ffs_wc_path, stackp->ffs_level - 1, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// we are done with the current directory
|
// we are done with the current directory
|
||||||
ff_free_stack_element(stackp);
|
ff_free_stack_element(stackp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
// If we reached this, we didn't find anything downwards.
|
// If we reached this, we didn't find anything downwards.
|
||||||
// Let's check if we should do an upward search.
|
// Let's check if we should do an upward search.
|
||||||
if (search_ctx->ffsc_start_dir
|
if (search_ctx->ffsc_start_dir
|
||||||
@@ -1173,7 +1118,6 @@ vim_findfile(void *search_ctx_arg)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
vim_free(file_path);
|
vim_free(file_path);
|
||||||
@@ -1222,9 +1166,7 @@ ff_free_visited_list(ff_visited_T *vl)
|
|||||||
while (vl != NULL)
|
while (vl != NULL)
|
||||||
{
|
{
|
||||||
vp = vl->ffv_next;
|
vp = vl->ffv_next;
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
vim_free(vl->ffv_wc_path);
|
vim_free(vl->ffv_wc_path);
|
||||||
#endif
|
|
||||||
vim_free(vl);
|
vim_free(vl);
|
||||||
vl = vp;
|
vl = vp;
|
||||||
}
|
}
|
||||||
@@ -1298,7 +1240,6 @@ ff_get_visited_list(
|
|||||||
return retptr;
|
return retptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
/*
|
/*
|
||||||
* check if two wildcard paths are equal. Returns TRUE or FALSE.
|
* check if two wildcard paths are equal. Returns TRUE or FALSE.
|
||||||
* They are equal if:
|
* They are equal if:
|
||||||
@@ -1339,7 +1280,6 @@ ff_wc_equal(char_u *s1, char_u *s2)
|
|||||||
}
|
}
|
||||||
return s1[i] == s2[j];
|
return s1[i] == s2[j];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* maintains the list of already visited files and dirs
|
* maintains the list of already visited files and dirs
|
||||||
@@ -1353,11 +1293,8 @@ ff_wc_equal(char_u *s1, char_u *s2)
|
|||||||
static int
|
static int
|
||||||
ff_check_visited(
|
ff_check_visited(
|
||||||
ff_visited_T **visited_list,
|
ff_visited_T **visited_list,
|
||||||
char_u *fname
|
char_u *fname,
|
||||||
#ifdef FEAT_PATH_EXTRA
|
char_u *wc_path)
|
||||||
, char_u *wc_path
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ff_visited_T *vp;
|
ff_visited_T *vp;
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
@@ -1397,10 +1334,8 @@ ff_check_visited(
|
|||||||
fnamecmp(vp->ffv_fname, ff_expand_buffer) == 0
|
fnamecmp(vp->ffv_fname, ff_expand_buffer) == 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
// are the wildcard parts equal
|
// are the wildcard parts equal
|
||||||
if (ff_wc_equal(vp->ffv_wc_path, wc_path) == TRUE)
|
if (ff_wc_equal(vp->ffv_wc_path, wc_path) == TRUE)
|
||||||
#endif
|
|
||||||
// already visited
|
// already visited
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@@ -1429,12 +1364,10 @@ ff_check_visited(
|
|||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
if (wc_path != NULL)
|
if (wc_path != NULL)
|
||||||
vp->ffv_wc_path = vim_strsave(wc_path);
|
vp->ffv_wc_path = vim_strsave(wc_path);
|
||||||
else
|
else
|
||||||
vp->ffv_wc_path = NULL;
|
vp->ffv_wc_path = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
vp->ffv_next = *visited_list;
|
vp->ffv_next = *visited_list;
|
||||||
*visited_list = vp;
|
*visited_list = vp;
|
||||||
@@ -1449,9 +1382,7 @@ ff_check_visited(
|
|||||||
static ff_stack_T *
|
static ff_stack_T *
|
||||||
ff_create_stack_element(
|
ff_create_stack_element(
|
||||||
char_u *fix_part,
|
char_u *fix_part,
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
char_u *wc_part,
|
char_u *wc_part,
|
||||||
#endif
|
|
||||||
int level,
|
int level,
|
||||||
int star_star_empty)
|
int star_star_empty)
|
||||||
{
|
{
|
||||||
@@ -1474,17 +1405,11 @@ ff_create_stack_element(
|
|||||||
fix_part = (char_u *)"";
|
fix_part = (char_u *)"";
|
||||||
new->ffs_fix_path = vim_strsave(fix_part);
|
new->ffs_fix_path = vim_strsave(fix_part);
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
if (wc_part == NULL)
|
if (wc_part == NULL)
|
||||||
wc_part = (char_u *)"";
|
wc_part = (char_u *)"";
|
||||||
new->ffs_wc_path = vim_strsave(wc_part);
|
new->ffs_wc_path = vim_strsave(wc_part);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (new->ffs_fix_path == NULL
|
if (new->ffs_fix_path == NULL || new->ffs_wc_path == NULL)
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
|| new->ffs_wc_path == NULL
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ff_free_stack_element(new);
|
ff_free_stack_element(new);
|
||||||
new = NULL;
|
new = NULL;
|
||||||
@@ -1532,9 +1457,7 @@ ff_free_stack_element(ff_stack_T *stack_ptr)
|
|||||||
{
|
{
|
||||||
// vim_free handles possible NULL pointers
|
// vim_free handles possible NULL pointers
|
||||||
vim_free(stack_ptr->ffs_fix_path);
|
vim_free(stack_ptr->ffs_fix_path);
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
vim_free(stack_ptr->ffs_wc_path);
|
vim_free(stack_ptr->ffs_wc_path);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (stack_ptr->ffs_filearray != NULL)
|
if (stack_ptr->ffs_filearray != NULL)
|
||||||
FreeWild(stack_ptr->ffs_filearray_size, stack_ptr->ffs_filearray);
|
FreeWild(stack_ptr->ffs_filearray_size, stack_ptr->ffs_filearray);
|
||||||
@@ -1557,11 +1480,8 @@ ff_clear(ff_search_ctx_T *search_ctx)
|
|||||||
vim_free(search_ctx->ffsc_file_to_search);
|
vim_free(search_ctx->ffsc_file_to_search);
|
||||||
vim_free(search_ctx->ffsc_start_dir);
|
vim_free(search_ctx->ffsc_start_dir);
|
||||||
vim_free(search_ctx->ffsc_fix_path);
|
vim_free(search_ctx->ffsc_fix_path);
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
vim_free(search_ctx->ffsc_wc_path);
|
vim_free(search_ctx->ffsc_wc_path);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
if (search_ctx->ffsc_stopdirs_v != NULL)
|
if (search_ctx->ffsc_stopdirs_v != NULL)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -1574,19 +1494,15 @@ ff_clear(ff_search_ctx_T *search_ctx)
|
|||||||
vim_free(search_ctx->ffsc_stopdirs_v);
|
vim_free(search_ctx->ffsc_stopdirs_v);
|
||||||
}
|
}
|
||||||
search_ctx->ffsc_stopdirs_v = NULL;
|
search_ctx->ffsc_stopdirs_v = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
// reset everything
|
// reset everything
|
||||||
search_ctx->ffsc_file_to_search = NULL;
|
search_ctx->ffsc_file_to_search = NULL;
|
||||||
search_ctx->ffsc_start_dir = NULL;
|
search_ctx->ffsc_start_dir = NULL;
|
||||||
search_ctx->ffsc_fix_path = NULL;
|
search_ctx->ffsc_fix_path = NULL;
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
search_ctx->ffsc_wc_path = NULL;
|
search_ctx->ffsc_wc_path = NULL;
|
||||||
search_ctx->ffsc_level = 0;
|
search_ctx->ffsc_level = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
/*
|
/*
|
||||||
* check if the given path is in the stopdirs
|
* check if the given path is in the stopdirs
|
||||||
* returns TRUE if yes else FALSE
|
* returns TRUE if yes else FALSE
|
||||||
@@ -1623,7 +1539,6 @@ ff_path_in_stoplist(char_u *path, int path_len, char_u **stopdirs_v)
|
|||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the file name "ptr[len]" in the path. Also finds directory names.
|
* Find the file name "ptr[len]" in the path. Also finds directory names.
|
||||||
@@ -1873,12 +1788,8 @@ find_file_in_path_option(
|
|||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
copy_option_part(&dir, buf, MAXPATHL, " ,");
|
copy_option_part(&dir, buf, MAXPATHL, " ,");
|
||||||
|
|
||||||
# ifdef FEAT_PATH_EXTRA
|
|
||||||
// get the stopdir string
|
// get the stopdir string
|
||||||
r_ptr = vim_findfile_stopdir(buf);
|
r_ptr = vim_findfile_stopdir(buf);
|
||||||
# else
|
|
||||||
r_ptr = NULL;
|
|
||||||
# endif
|
|
||||||
fdip_search_ctx = vim_findfile_init(buf, ff_file_to_find,
|
fdip_search_ctx = vim_findfile_init(buf, ff_file_to_find,
|
||||||
r_ptr, 100, FALSE, find_what,
|
r_ptr, 100, FALSE, find_what,
|
||||||
fdip_search_ctx, FALSE, rel_fname);
|
fdip_search_ctx, FALSE, rel_fname);
|
||||||
|
@@ -3398,11 +3398,7 @@ get_tagfname(
|
|||||||
buf[0] = NUL;
|
buf[0] = NUL;
|
||||||
(void)copy_option_part(&tnp->tn_np, buf, MAXPATHL - 1, " ,");
|
(void)copy_option_part(&tnp->tn_np, buf, MAXPATHL - 1, " ,");
|
||||||
|
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
r_ptr = vim_findfile_stopdir(buf);
|
r_ptr = vim_findfile_stopdir(buf);
|
||||||
#else
|
|
||||||
r_ptr = NULL;
|
|
||||||
#endif
|
|
||||||
// move the filename one char forward and truncate the
|
// move the filename one char forward and truncate the
|
||||||
// filepath with a NUL
|
// filepath with a NUL
|
||||||
filename = gettail(buf);
|
filename = gettail(buf);
|
||||||
|
@@ -448,11 +448,7 @@ static char *(features[]) =
|
|||||||
#else
|
#else
|
||||||
"-packages",
|
"-packages",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PATH_EXTRA
|
|
||||||
"+path_extra",
|
"+path_extra",
|
||||||
#else
|
|
||||||
"-path_extra",
|
|
||||||
#endif
|
|
||||||
#ifdef FEAT_PERL
|
#ifdef FEAT_PERL
|
||||||
# ifdef DYNAMIC_PERL
|
# ifdef DYNAMIC_PERL
|
||||||
"+perl/dyn",
|
"+perl/dyn",
|
||||||
@@ -727,6 +723,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
270,
|
||||||
/**/
|
/**/
|
||||||
269,
|
269,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user