diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-18 14:31:40 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-18 14:35:04 +0800 |
commit | 9180c18c462a4945657899b732189da6f2ea2eaf (patch) | |
tree | 3593a69df64cbf4496e8739a14d8976dde90a57b /test | |
parent | 2a94dcf0c592464222c87f5606799ca51a0b9c07 (diff) | |
download | rneovim-9180c18c462a4945657899b732189da6f2ea2eaf.tar.gz rneovim-9180c18c462a4945657899b732189da6f2ea2eaf.tar.bz2 rneovim-9180c18c462a4945657899b732189da6f2ea2eaf.zip |
vim-patch:9.0.0864: crash when using "!!" without a previous shell command
Problem: Crash when using "!!" without a previous shell command.
Solution: Check "prevcmd" is not NULL. (closes vim/vim#11487)
https://github.com/vim/vim/commit/6600447c7b0a1be3a64d07a318bacdfaae0cac4b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_shell.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/old/testdir/test_shell.vim b/test/old/testdir/test_shell.vim index 828fd1fa40..7172d5ba33 100644 --- a/test/old/testdir/test_shell.vim +++ b/test/old/testdir/test_shell.vim @@ -237,4 +237,17 @@ func Test_shell_repeat() let &shell = save_shell endfunc +func Test_shell_no_prevcmd() + " this doesn't do anything, just check it doesn't crash + let after =<< trim END + exe "normal !!\<CR>" + call writefile([v:errmsg, 'done'], 'Xtestdone') + qall! + END + if RunVim([], after, '--clean') + call assert_equal(['E34: No previous command', 'done'], readfile('Xtestdone')) + endif + call delete('Xtestdone') +endfunc + " vim: shiftwidth=2 sts=2 expandtab |