Problem: Some functions return a different value on failure.
Solution: Initialize the return value earlier. (Yegappan Lakshmanan,
closes #10568)
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;
}
}
- if (rettv_list_alloc(rettv) == FAIL)
- return;
event_list = rettv->vval.v_list;
// iterate through all the autocmd events
dict_T *d;
int todo;
+ if (rettv_list_alloc(rettv) == FAIL)
+ return;
+
if (in_vim9script() && check_for_dict_arg(argvars, 0) == FAIL)
return;
return;
}
- if (rettv_list_alloc(rettv) == FAIL)
- return;
if ((d = argvars[0].vval.v_dict) == NULL)
// empty dict behaves like an empty dict
return;
varnumber_T stride = 1;
int error = FALSE;
+ if (rettv_list_alloc(rettv) != OK)
+ return;
+
if (in_vim9script()
&& (check_for_number_arg(argvars, 0) == FAIL
|| check_for_opt_number_arg(argvars, 1) == FAIL
emsg(_(e_stride_is_zero));
else if (stride > 0 ? end + 1 < start : end - 1 > start)
emsg(_(e_start_past_end));
- else if (rettv_list_alloc(rettv) == OK)
+ else
{
list_T *list = rettv->vval.v_list;
garray_T ga;
char_u *sep;
+ rettv->v_type = VAR_STRING;
+
if (in_vim9script()
&& (check_for_list_arg(argvars, 0) == FAIL
|| check_for_opt_string_arg(argvars, 1) == FAIL))
emsg(_(e_list_required));
return;
}
- rettv->v_type = VAR_STRING;
+
if (argvars[0].vval.v_list == NULL)
return;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 5089,
/**/
5088,
/**/