vim-patch:9.1.0182: Can define function with invalid name inside 'formatexpr' (#27883)

Problem:  Can define function with invalid name inside 'formatexpr'.
Solution: Use goto instead of checking for did_emsg later.
          (zeertzjq)

closes: vim/vim#14209

6a04bf5ee5
This commit is contained in:
zeertzjq
2024-03-16 17:26:14 +08:00
committed by GitHub
parent c0daea3afd
commit ee89ba1d75
2 changed files with 20 additions and 0 deletions

View File

@@ -2309,6 +2309,7 @@ void ex_function(exarg_T *eap)
: eval_isnamec(name_base[i])); i++) {}
if (name_base[i] != NUL) {
emsg_funcname(e_invarg2, arg);
goto ret_free;
}
}
// Disallow using the g: dict.