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:
committed by
Bram Moolenaar
parent
cd7496382e
commit
ca195cc84f
@@ -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
|
||||
|
Reference in New Issue
Block a user