mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.1.0923: too many strlen() calls in filepath.c
Problem: too many strlen() calls in filepath.c Solution: refactor filepath.c and remove calls to STRLEN(), unify dos_expandpath() and unix_expandpath() into a single function closes: #16160 Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
618c4d36ca
commit
e29c8bafa7
663
src/filepath.c
663
src/filepath.c
File diff suppressed because it is too large
Load Diff
@ -6796,21 +6796,6 @@ select_eintr:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Expand a path into all matching files and/or directories. Handles "*",
|
|
||||||
* "?", "[a-z]", "**", etc.
|
|
||||||
* "path" has backslashes before chars that are not to be expanded.
|
|
||||||
* Returns the number of matches found.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
mch_expandpath(
|
|
||||||
garray_T *gap,
|
|
||||||
char_u *path,
|
|
||||||
int flags) // EW_* flags
|
|
||||||
{
|
|
||||||
return unix_expandpath(gap, path, 0, flags, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mch_expand_wildcards() - this code does wild-card pattern matching using
|
* mch_expand_wildcards() - this code does wild-card pattern matching using
|
||||||
* the shell
|
* the shell
|
||||||
|
@ -56,6 +56,7 @@ int expand_wildcards_eval(char_u **pat, int *num_file, char_u ***file, int flags
|
|||||||
int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files, int flags);
|
int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files, int flags);
|
||||||
int match_suffix(char_u *fname);
|
int match_suffix(char_u *fname);
|
||||||
int unix_expandpath(garray_T *gap, char_u *path, int wildoff, int flags, int didstar);
|
int unix_expandpath(garray_T *gap, char_u *path, int wildoff, int flags, int didstar);
|
||||||
|
int mch_expandpath(garray_T *gap, char_u *path, int flags);
|
||||||
int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags);
|
int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags);
|
||||||
void addfile(garray_T *gap, char_u *f, int flags);
|
void addfile(garray_T *gap, char_u *f, int flags);
|
||||||
void FreeWild(int count, char_u **files);
|
void FreeWild(int count, char_u **files);
|
||||||
|
@ -704,6 +704,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 */
|
||||||
|
/**/
|
||||||
|
923,
|
||||||
/**/
|
/**/
|
||||||
922,
|
922,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user