aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-11-10 08:07:16 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-10 18:47:03 -0300
commitab826d88f69a3cc2785baa6367d3bd01dbb84627 (patch)
tree31a708e854829a239af73146ae6bf3653f8d10ad /src
parent63a98fca552b1f7197dd2a37764a57604e3746e8 (diff)
downloadrneovim-ab826d88f69a3cc2785baa6367d3bd01dbb84627.tar.gz
rneovim-ab826d88f69a3cc2785baa6367d3bd01dbb84627.tar.bz2
rneovim-ab826d88f69a3cc2785baa6367d3bd01dbb84627.zip
eval: Return an empty list from systemlist() when there's no output
This is the behavior on vim's `systemlist()`.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 59363a3608..fc61fed529 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -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;
}