mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
No OOM in expand_shellcmd()
This commit is contained in:
@@ -3655,8 +3655,10 @@ ExpandFromContext (
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xp->xp_context == EXPAND_SHELLCMD)
|
if (xp->xp_context == EXPAND_SHELLCMD) {
|
||||||
return expand_shellcmd(pat, num_file, file, flags);
|
expand_shellcmd(pat, num_file, file, flags);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
if (xp->xp_context == EXPAND_OLD_SETTING)
|
if (xp->xp_context == EXPAND_OLD_SETTING)
|
||||||
return ExpandOldSetting(num_file, file);
|
return ExpandOldSetting(num_file, file);
|
||||||
if (xp->xp_context == EXPAND_BUFFERS)
|
if (xp->xp_context == EXPAND_BUFFERS)
|
||||||
@@ -3836,9 +3838,8 @@ int ExpandGeneric(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Complete a shell command.
|
* Complete a shell command.
|
||||||
* Returns FAIL or OK;
|
|
||||||
*/
|
*/
|
||||||
static int
|
static void
|
||||||
expand_shellcmd (
|
expand_shellcmd (
|
||||||
char_u *filepat, /* pattern to match with command names */
|
char_u *filepat, /* pattern to match with command names */
|
||||||
int *num_file, /* return: number of matches */
|
int *num_file, /* return: number of matches */
|
||||||
@@ -3926,7 +3927,6 @@ expand_shellcmd (
|
|||||||
free(pat);
|
free(pat);
|
||||||
if (mustfree)
|
if (mustfree)
|
||||||
free(path);
|
free(path);
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user