Mercurial > vim
diff src/list.c @ 29138:175eacde28b8 v8.2.5089
patch 8.2.5089: some functions return a different value on failure
Commit: https://github.com/vim/vim/commit/ca195cc84fb3f5e497cdbc5f1f53dc1d7efedf48
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Jun 14 13:42:26 2022 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Jun 2022 14:45:07 +0200 |
parents | fff70771d4bb |
children | 755ab148288b |
line wrap: on
line diff
--- a/src/list.c +++ b/src/list.c @@ -1440,6 +1440,8 @@ f_join(typval_T *argvars, typval_T *rett 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 @@ f_join(typval_T *argvars, typval_T *rett emsg(_(e_list_required)); return; } - rettv->v_type = VAR_STRING; + if (argvars[0].vval.v_list == NULL) return;