aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-04 13:49:19 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-04 13:51:01 +0800
commit7ddf235d7e71ee8373b11baa6a49381311f5d61d (patch)
treeef2a8f106faec12f3ba4d9e67a6be4db04fa3e43 /test
parent7e70a1e44b223a51f4d8f06b9fe4c4ef77601f83 (diff)
downloadrneovim-7ddf235d7e71ee8373b11baa6a49381311f5d61d.tar.gz
rneovim-7ddf235d7e71ee8373b11baa6a49381311f5d61d.tar.bz2
rneovim-7ddf235d7e71ee8373b11baa6a49381311f5d61d.zip
vim-patch:9.0.0240: crash when using ":mkspell" with an empty .dic file
Problem: Crash when using ":mkspell" with an empty .dic file. Solution: Check for an empty word tree. https://github.com/vim/vim/commit/6669de1b235843968e88844ca6d3c8dec4b01a9e Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_spellfile.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/old/testdir/test_spellfile.vim b/test/old/testdir/test_spellfile.vim
index 639ebc1c34..4d2a6cf35f 100644
--- a/test/old/testdir/test_spellfile.vim
+++ b/test/old/testdir/test_spellfile.vim
@@ -1071,4 +1071,16 @@ func Test_spellfile_allow_at_character()
call delete('Xtest', 'rf')
endfunc
+" this was using a NULL pointer
+func Test_mkspell_empty_dic()
+ call writefile(['1'], 'XtestEmpty.dic')
+ call writefile(['SOFOFROM abcd', 'SOFOTO ABCD', 'SAL CIA X'], 'XtestEmpty.aff')
+ mkspell! XtestEmpty.spl XtestEmpty
+
+ call delete('XtestEmpty.dic')
+ call delete('XtestEmpty.aff')
+ call delete('XtestEmpty.spl')
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab