patch 8.1.1319: computing function length name in many places
Problem: Computing function length name in many places.
Solution: compute name length in call_func().
diff --git a/src/evalfunc.c b/src/evalfunc.c
index ff51d12..02ca1ae 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -767,6 +767,8 @@
{"line2byte", 1, 1, f_line2byte},
{"lispindent", 1, 1, f_lispindent},
{"list2str", 1, 2, f_list2str},
+ {"listener_add", 1, 2, f_listener_add},
+ {"listener_remove", 1, 1, f_listener_remove},
{"localtime", 0, 0, f_localtime},
#ifdef FEAT_FLOAT
{"log", 1, 1, f_log},
@@ -9746,9 +9748,9 @@
if (failed)
{
+ // an empty list is returned on error
list_free(rettv->vval.v_list);
- /* readfile doc says an empty list is returned on error */
- rettv->vval.v_list = list_alloc();
+ rettv_list_alloc(rettv);
}
vim_free(prev);
@@ -12644,8 +12646,7 @@
copy_tv(&si2->item->li_tv, &argv[1]);
rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */
- res = call_func(func_name, (int)STRLEN(func_name),
- &rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE,
+ res = call_func(func_name, -1, &rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE,
partial, sortinfo->item_compare_selfdict);
clear_tv(&argv[0]);
clear_tv(&argv[1]);