diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-31 11:51:21 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-31 11:51:21 +0100 |
commit | 49d008d96b80d17e9770b066031aaaf9495761e2 (patch) | |
tree | f63fddee7914fd3f2c6c60b148c14b928bcfe4a4 /src/vim9script.c | |
parent | 4dea2d92e4c308b064ed1dd7b2ba7527a0d6b0a0 (diff) | |
download | vim-git-49d008d96b80d17e9770b066031aaaf9495761e2.tar.gz |
patch 8.2.4654: missing changes for import checkv8.2.4654
Problem: Missing changes for import check.
Solution: Add missing changes.
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 0dad36ff6..a63f2f7dd 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -399,7 +399,14 @@ handle_import_fname(char_u *fname, int is_autoload, int *sid) { int error = OK; - // script does not exist yet, create a new scriptitem + // Script does not exist yet, check name and create a new + // scriptitem. + if (!file_is_readable(fname)) + { + semsg(_(mch_isdir(fname) ? e_str_is_directory + : e_cannot_read_from_str_2), fname); + return FAIL; + } *sid = get_new_scriptitem_for_fname(&error, fname); if (error == FAIL) return FAIL; |