0
0
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:
John Marriott 2024-12-13 13:58:53 +01:00 committed by Christian Brabandt
parent 618c4d36ca
commit e29c8bafa7
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
4 changed files with 340 additions and 405 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6796,21 +6796,6 @@ select_eintr:
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
* the shell

View File

@ -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 match_suffix(char_u *fname);
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);
void addfile(garray_T *gap, char_u *f, int flags);
void FreeWild(int count, char_u **files);

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
923,
/**/
922,
/**/