1
0
forked from aniani/vim

patch 9.0.0476: varargs does not work for replacement function of substitute()

Problem:    Varargs does not work for replacement function of substitute().
Solution:   Check the varargs flag of the function. (closes #11142)
This commit is contained in:
zeertzjq
2022-09-16 12:10:03 +01:00
committed by Bram Moolenaar
parent dd674774bb
commit 48db5dafec
5 changed files with 20 additions and 14 deletions

View File

@@ -1817,14 +1817,14 @@ static regsubmatch_T rsm; // can only be used when can_f_submatch is TRUE
* call_func() by vim_regsub_both().
*/
static int
fill_submatch_list(int argc UNUSED, typval_T *argv, int argskip, int argcount)
fill_submatch_list(int argc UNUSED, typval_T *argv, int argskip, ufunc_T *fp)
{
listitem_T *li;
int i;
char_u *s;
typval_T *listarg = argv + argskip;
if (argcount == argskip)
if (!fp->uf_varargs && fp->uf_args.ga_len <= argskip)
// called function doesn't take a submatches argument
return argskip;