diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-03 18:17:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-03 18:17:11 +0200 |
commit | c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a (patch) | |
tree | 80b89c210388f6e038ccbdc346f72a31bffd8430 /src/list.c | |
parent | 749fa0af85232be1d44b77a09161f71cdbace62c (diff) | |
download | vim-git-c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a.tar.gz |
patch 8.1.1800: function call functions have too many argumentsv8.1.1800
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
Diffstat (limited to 'src/list.c')
-rw-r--r-- | src/list.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/list.c b/src/list.c index c2bf4909c..fc348672b 100644 --- a/src/list.c +++ b/src/list.c @@ -1284,9 +1284,9 @@ item_compare2(const void *s1, const void *s2) int res; typval_T rettv; typval_T argv[3]; - int dummy; char_u *func_name; partial_T *partial = sortinfo->item_compare_partial; + funcexe_T funcexe; /* shortcut after failure in previous call; compare all items equal */ if (sortinfo->item_compare_func_err) @@ -1306,8 +1306,11 @@ item_compare2(const void *s1, const void *s2) copy_tv(&si2->item->li_tv, &argv[1]); rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ - res = call_func(func_name, -1, &rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE, - partial, sortinfo->item_compare_selfdict); + vim_memset(&funcexe, 0, sizeof(funcexe)); + funcexe.evaluate = TRUE; + funcexe.partial = partial; + funcexe.selfdict = sortinfo->item_compare_selfdict; + res = call_func(func_name, -1, &rettv, 2, argv, &funcexe); clear_tv(&argv[0]); clear_tv(&argv[1]); |