diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-07 13:38:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-07 13:38:24 +0000 |
commit | 834d41853e12b9022f60b08c32480928c2a9e48f (patch) | |
tree | d31a9bc977f3845b4fb62bfab159296c0c85f5c7 /src/vim9script.c | |
parent | 32884ad753ffb462d27998beb50678888209075f (diff) | |
download | vim-git-834d41853e12b9022f60b08c32480928c2a9e48f.tar.gz |
patch 8.2.4025: error for import not ending in .vim does not work for .vimrcv8.2.4025
Problem: Error for import not ending in .vim does not work for .vimrc.
Solution: Check that .vim is the end. (closes #9484)
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 81f396759..4d16a2a7a 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -474,10 +474,14 @@ handle_import( semsg(_(e_trailing_characters_str), expr_end); goto erret; } - - if (end == NULL) + if (end == NULL || end[4] != NUL) + { + semsg(_(e_imported_script_must_use_as_or_end_in_dot_vim_str), p); + goto erret; + } + if (end == p) { - semsg(_(e_imported_script_must_end_in_dot_vim_str), p); + semsg(_(e_cannot_import_dot_vim_without_using_as), p); goto erret; } as_name = vim_strnsave(p, end - p); |