mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
fix(api): vim.cmd.make
crashes when argument count isn't 1 (#19701)
Closes #19696
This commit is contained in:
@@ -819,9 +819,12 @@ static void build_cmdline_str(char **cmdlinep, exarg_T *eap, CmdParseInfo *cmdin
|
||||
char *p = replace_makeprg(eap, eap->arg, cmdlinep);
|
||||
if (p != eap->arg) {
|
||||
// If replace_makeprg modified the cmdline string, correct the argument pointers.
|
||||
assert(argc == 1);
|
||||
eap->arg = p;
|
||||
eap->args[0] = p;
|
||||
// We can only know the position of the first argument because the argument list can be used
|
||||
// multiple times in makeprg / grepprg.
|
||||
if (argc >= 1) {
|
||||
eap->args[0] = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user