diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-09-26 15:34:17 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-09-30 21:00:17 -0400 |
commit | 2a57dce9f2ea157a6f9b15613788cdd8cebc26e5 (patch) | |
tree | 74fb8a6dba09c1dc4e4bdc41fc7e3da4bada6bee /src/nvim/eval.c | |
parent | 4edf7b9ff22ca702876a7d0b5534fa2fc16b1897 (diff) | |
download | rneovim-2a57dce9f2ea157a6f9b15613788cdd8cebc26e5.tar.gz rneovim-2a57dce9f2ea157a6f9b15613788cdd8cebc26e5.tar.bz2 rneovim-2a57dce9f2ea157a6f9b15613788cdd8cebc26e5.zip |
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().
https://github.com/vim/vim/commit/6ed8819822994512c160006bd1204aa11ae3c494
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.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 00542e3766..24192dfefa 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -736,7 +736,7 @@ int eval_expr_typval(const typval_T *expr, typval_T *argv, if (s == NULL || *s == NUL) { return FAIL; } - if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL, + if (call_func(s, -1, rettv, argc, argv, NULL, 0L, 0L, &dummy, true, NULL, NULL) == FAIL) { return FAIL; } @@ -746,7 +746,7 @@ int eval_expr_typval(const typval_T *expr, typval_T *argv, if (s == NULL || *s == NUL) { return FAIL; } - if (call_func(s, (int)STRLEN(s), rettv, argc, argv, NULL, + if (call_func(s, -1, rettv, argc, argv, NULL, 0L, 0L, &dummy, true, partial, NULL) == FAIL) { return FAIL; } @@ -7270,7 +7270,7 @@ bool callback_call(Callback *const callback, const int argcount_in, } int dummy; - return call_func(name, (int)STRLEN(name), rettv, argcount_in, argvars_in, + return call_func(name, -1, rettv, argcount_in, argvars_in, NULL, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, partial, NULL); } @@ -8492,7 +8492,7 @@ handle_subscript( } else { s = (char_u *)""; } - ret = get_func_tv(s, lua ? slen : (int)STRLEN(s), rettv, (char_u **)arg, + ret = get_func_tv(s, lua ? slen : -1, rettv, (char_u **)arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, pt, selfdict); |