summaryrefslogtreecommitdiffstats
path: root/src/list.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-03 18:17:11 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-03 18:17:11 +0200
commitc6538bcc1cdd1fb83732f22fdc69bd9bb66f968a (patch)
tree80b89c210388f6e038ccbdc346f72a31bffd8430 /src/list.c
parent749fa0af85232be1d44b77a09161f71cdbace62c (diff)
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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/list.c b/src/list.c
index c2bf4909cc..fc348672b4 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]);