system(): Return an empty string if no output.

fixes #2286
This commit is contained in:
Scott Prager 2015-03-31 00:10:31 -04:00
parent 0f6e25a9e4
commit 41ce69811a

View File

@ -14863,6 +14863,8 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
if (retlist) {
// return an empty list when there's no output
rettv_list_alloc(rettv);
} else {
rettv->vval.v_string = (char_u *) xstrdup("");
}
return;
}