diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-08 19:12:19 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-08 19:12:19 +0000 |
commit | 779aeff5c32c26161f42cdccbaa2376e78ee77d6 (patch) | |
tree | 6b03c4f29dc69bd14973d1ab2798a2c2a377b8e2 /src/vim9script.c | |
parent | e023d499378942a6c3a3855cbe461ec2cb570f63 (diff) | |
download | vim-git-779aeff5c32c26161f42cdccbaa2376e78ee77d6.tar.gz |
patch 8.2.4330: Vim9: no error if script imports itselfv8.2.4330
Problem: Vim9: no error if script imports itself.
Solution: Give an error when a script imports itself.
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 5c1c05566..872108827 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -516,6 +516,12 @@ handle_import( goto erret; } + if (sid == current_sctx.sc_sid) + { + emsg(_(e_script_cannot_import_itself)); + goto erret; + } + import_gap = gap != NULL ? gap : &SCRIPT_ITEM(import_sid)->sn_imports; for (i = 0; i < import_gap->ga_len; ++i) { |