From ab826d88f69a3cc2785baa6367d3bd01dbb84627 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 10 Nov 2014 08:07:16 -0300 Subject: eval: Return an empty list from systemlist() when there's no output This is the behavior on vim's `systemlist()`. --- src/nvim/eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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; } -- cgit