vim-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().
6ed8819822

In call_func(), reassign "len" param to (int)STRLEN(funcname)
instead of using vim_strsave() which runs strlen().
"len" param is checked for v:lua functions.
call_func() states that strlen() is used if "len" is set to -1.
This commit is contained in:
Jan Edmund Lazo
2020-09-26 15:34:17 -04:00
parent 4edf7b9ff2
commit 2a57dce9f2
5 changed files with 15 additions and 12 deletions

View File

@@ -9174,7 +9174,7 @@ static int item_compare2(const void *s1, const void *s2, bool keep_zero)
rettv.v_type = VAR_UNKNOWN; // tv_clear() uses this
res = call_func((const char_u *)func_name,
(int)STRLEN(func_name),
-1,
&rettv, 2, argv, NULL, 0L, 0L, &dummy, true,
partial, sortinfo->item_compare_selfdict);
tv_clear(&argv[0]);