0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2280: crash when passing partial to substitute()

Problem:    Crash when passing partial to substitute().
Solution:   Take extra arguments into account. (closes #5186)
This commit is contained in:
Bram Moolenaar
2019-11-09 22:28:11 +01:00
parent dbd4316806
commit b0745b221d
6 changed files with 29 additions and 16 deletions

View File

@@ -1627,10 +1627,11 @@ typedef struct
//
// "argv_func", when not NULL, can be used to fill in arguments only when the
// invoked function uses them. It is called like this:
// new_argcount = argv_func(current_argcount, argv, called_func_argcount)
// new_argcount = argv_func(current_argcount, argv, partial_argcount,
// called_func_argcount)
//
typedef struct {
int (* argv_func)(int, typval_T *, int);
int (* argv_func)(int, typval_T *, int, int);
linenr_T firstline; // first line of range
linenr_T lastline; // last line of range
int *doesrange; // if not NULL: return: function handled range