0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.3889: duplicate code for translating script-local function name

Problem:    Duplicate code for translating script-local function name.
Solution:   Move the code to get_scriptlocal_funcname(). (Yegappan Lakshmanan,
            closes #9393)
This commit is contained in:
Yegappan Lakshmanan
2021-12-24 20:47:38 +00:00
committed by Bram Moolenaar
parent 73a024209c
commit e7f4abd38b
8 changed files with 84 additions and 39 deletions

View File

@@ -4450,7 +4450,18 @@ get_callback(typval_T *arg)
r = FAIL;
else if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
{
// Note that we don't make a copy of the string.
if (arg->v_type == VAR_STRING)
{
char_u *name;
name = get_scriptlocal_funcname(arg->vval.v_string);
if (name != NULL)
{
vim_free(arg->vval.v_string);
arg->vval.v_string = name;
}
}
res.cb_name = arg->vval.v_string;
func_ref(res.cb_name);
}