mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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.
This commit is contained in:
14
src/regexp.c
14
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 */
|
||||
|
Reference in New Issue
Block a user