0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3807: Vim9: can call import with star directly

Problem:    Vim9: can call import with star directly.
Solution:   Check that the import used star.
This commit is contained in:
Bram Moolenaar
2021-12-14 12:06:16 +00:00
parent c2958585f6
commit f8a79fc346
4 changed files with 28 additions and 2 deletions

View File

@@ -1596,7 +1596,16 @@ deref_func_name(
*lenp = (int)STRLEN(s);
return s;
}
// TODO: what if (import->imp_flags & IMP_FLAGS_STAR)
if (import->imp_flags & IMP_FLAGS_STAR)
{
name[len] = NUL;
semsg(_(e_cannot_use_str_itself_it_is_imported_with_star),
name);
name[len] = cc;
*lenp = 0;
return (char_u *)""; // just in case
}
else
{
scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)