mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
system([...]): Set v:shell_error=-1 if not executable.
Do _not_ set v:shell_error on parameter validation error. system([...]) does not invoke a shell, so this change is somewhat questionable. But `:help v:shell_error` is sufficiently vague to allow -1 in this case.
This commit is contained in:

committed by
Justin M. Keyes

parent
4178e865d5
commit
1e079fa987
@@ -16994,8 +16994,12 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
|
||||
}
|
||||
|
||||
// get shell command to execute
|
||||
char **argv = tv_to_argv(&argvars[0], NULL, NULL);
|
||||
bool executable = true;
|
||||
char **argv = tv_to_argv(&argvars[0], NULL, &executable);
|
||||
if (!argv) {
|
||||
if (!executable) {
|
||||
set_vim_var_nr(VV_SHELL_ERROR, (long)-1);
|
||||
}
|
||||
xfree(input);
|
||||
return; // Already did emsg.
|
||||
}
|
||||
|
Reference in New Issue
Block a user