mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(fileio.c): don't use uninitialized memory (#22031)
This commit is contained in:
parent
881d4adb59
commit
b4c4c232ba
@ -5439,6 +5439,10 @@ bool match_file_list(char *list, char *sfname, char *ffname)
|
||||
char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs, int no_bslash)
|
||||
FUNC_ATTR_NONNULL_ARG(1)
|
||||
{
|
||||
if (allow_dirs != NULL) {
|
||||
*allow_dirs = false;
|
||||
}
|
||||
|
||||
if (pat_end == NULL) {
|
||||
pat_end = pat + strlen(pat);
|
||||
}
|
||||
@ -5447,10 +5451,6 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
|
||||
return xstrdup("^$");
|
||||
}
|
||||
|
||||
if (allow_dirs != NULL) {
|
||||
*allow_dirs = false;
|
||||
}
|
||||
|
||||
size_t size = 2; // '^' at start, '$' at end.
|
||||
|
||||
for (const char *p = pat; p < pat_end; p++) {
|
||||
|
Loading…
Reference in New Issue
Block a user