summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-22 21:50:18 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-22 21:50:18 +0200
commitdf48fb456fb6bf63d94cad9b302ff01d8ee8d311 (patch)
treee40ac7facad1b205bf5990a535c8c1686fbeb05b /src/eval.c
parent36edf0685c8b55ee3ce709058d83ada8027fec1e (diff)
downloadvim-df48fb456fb6bf63d94cad9b302ff01d8ee8d311.zip
patch 7.4.2090
Problem: Using submatch() in a lambda passed to substitute() is verbose. Solution: Use a static list and pass it as an optional argument to the function. Fix memory leak.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 2ba90f94d..53c188bae 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -988,7 +988,7 @@ call_vim_function(
}
rettv->v_type = VAR_UNKNOWN; /* clear_tv() uses this */
- ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars,
+ ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars, NULL,
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
&doesrange, TRUE, NULL, NULL);
if (safe)
@@ -9930,8 +9930,8 @@ filter_map_one(typval_T *tv, typval_T *expr, int map, int *remp)
if (expr->v_type == VAR_FUNC)
{
s = expr->vval.v_string;
- if (call_func(s, (int)STRLEN(s),
- &rettv, 2, argv, 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL)
+ if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL,
+ 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL)
goto theend;
}
else if (expr->v_type == VAR_PARTIAL)
@@ -9939,9 +9939,8 @@ filter_map_one(typval_T *tv, typval_T *expr, int map, int *remp)
partial_T *partial = expr->vval.v_partial;
s = partial->pt_name;
- if (call_func(s, (int)STRLEN(s),
- &rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, NULL)
- == FAIL)
+ if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL,
+ 0L, 0L, &dummy, TRUE, partial, NULL) == FAIL)
goto theend;
}
else