1
0
forked from aniani/vim

patch 8.2.5089: some functions return a different value on failure

Problem:    Some functions return a different value on failure.
Solution:   Initialize the return value earlier. (Yegappan Lakshmanan,
            closes #10568)
This commit is contained in:
Yegappan Lakshmanan
2022-06-14 13:42:26 +01:00
committed by Bram Moolenaar
parent cd7496382e
commit ca195cc84f
5 changed files with 14 additions and 6 deletions

View File

@@ -3062,6 +3062,8 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
char_u *name = NULL;
int group = AUGROUP_ALL;
if (rettv_list_alloc(rettv) == FAIL)
return;
if (check_for_opt_dict_arg(argvars, 0) == FAIL)
return;
@@ -3128,8 +3130,6 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
}
}
if (rettv_list_alloc(rettv) == FAIL)
return;
event_list = rettv->vval.v_list;
// iterate through all the autocmd events