Mercurial > vim
diff src/regexp.c @ 17606:ff097edaae89 v8.1.1800
patch 8.1.1800: function call functions have too many arguments
commit https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 3 18:17:11 2019 +0200
patch 8.1.1800: function call functions have too many arguments
Problem: Function call functions have too many arguments.
Solution: Pass values in a funcexe_T struct.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Aug 2019 18:30:07 +0200 |
parents | f4ce361bb1e5 |
children | 121bdff812b4 |
line wrap: on
line diff
--- a/src/regexp.c +++ b/src/regexp.c @@ -7416,31 +7416,31 @@ vim_regsub_both( if (expr != NULL) { typval_T argv[2]; - int dummy; char_u buf[NUMBUFLEN]; typval_T rettv; staticList10_T matchList; + funcexe_T funcexe; rettv.v_type = VAR_STRING; rettv.vval.v_string = NULL; argv[0].v_type = VAR_LIST; argv[0].vval.v_list = &matchList.sl_list; matchList.sl_list.lv_len = 0; + vim_memset(&funcexe, 0, sizeof(funcexe)); + funcexe.argv_func = fill_submatch_list; + funcexe.evaluate = TRUE; if (expr->v_type == VAR_FUNC) { s = expr->vval.v_string; - call_func(s, -1, &rettv, - 1, argv, fill_submatch_list, - 0L, 0L, &dummy, TRUE, NULL, NULL); + call_func(s, -1, &rettv, 1, argv, &funcexe); } else if (expr->v_type == VAR_PARTIAL) { partial_T *partial = expr->vval.v_partial; s = partial_name(partial); - call_func(s, -1, &rettv, - 1, argv, fill_submatch_list, - 0L, 0L, &dummy, TRUE, partial, NULL); + funcexe.partial = partial; + call_func(s, -1, &rettv, 1, argv, &funcexe); } if (matchList.sl_list.lv_len > 0) /* fill_submatch_list() was called */