mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
eval: Return an empty list from systemlist() when there's no output
This is the behavior on vim's `systemlist()`.
This commit is contained in:
@@ -14492,6 +14492,11 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
|
||||
set_vim_var_nr(VV_SHELL_ERROR, (long) status);
|
||||
|
||||
if (res == NULL) {
|
||||
if (retlist) {
|
||||
// return an empty list when there's no output
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = list_alloc();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user