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)
diff --git a/src/list.c b/src/list.c
index 50bf3af..b9a3478 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1440,6 +1440,8 @@
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))
@@ -1450,7 +1452,7 @@
emsg(_(e_list_required));
return;
}
- rettv->v_type = VAR_STRING;
+
if (argvars[0].vval.v_list == NULL)
return;