To: vim_dev@googlegroups.com Subject: Patch 8.0.1225 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1225 Problem: No check for spell region being zero. (geeknik) Solution: Check for zero. (closes #2252) Files: src/spellfile.c, src/testdir/test_spell.vim *** ../vim-8.0.1224/src/spellfile.c 2017-03-12 19:22:31.768584844 +0100 --- src/spellfile.c 2017-10-26 22:09:18.724407454 +0200 *************** *** 4277,4283 **** flags |= WF_REGION; l = *p - '0'; ! if (l > spin->si_region_count) { smsg((char_u *)_("Invalid region nr in %s line %d: %s"), fname, lnum, p); --- 4277,4283 ---- flags |= WF_REGION; l = *p - '0'; ! if (l == 0 || l > spin->si_region_count) { smsg((char_u *)_("Invalid region nr in %s line %d: %s"), fname, lnum, p); *** ../vim-8.0.1224/src/testdir/test_spell.vim 2017-07-28 15:38:06.119839818 +0200 --- src/testdir/test_spell.vim 2017-10-26 22:21:41.355213477 +0200 *************** *** 271,276 **** --- 271,285 ---- call assert_equal("elekwint", SecondSpellWord()) endfunc + func Test_region_error() + messages clear + call writefile(["/regions=usgbnz", "elequint/0"], "Xtest.latin1.add") + mkspell! Xtest.latin1.add.spl Xtest.latin1.add + call assert_match('Invalid region nr in Xtest.latin1.add line 2: 0', execute('messages')) + call delete('Xtest.latin1.add') + call delete('Xtest.latin1.add.spl') + endfunc + " Check using z= in new buffer (crash fixed by patch 7.4a.028). func Test_zeq_crash() new *** ../vim-8.0.1224/src/version.c 2017-10-27 00:54:59.146125099 +0200 --- src/version.c 2017-10-27 00:56:16.385579512 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1225, /**/ -- ARTHUR: Ni! BEDEVERE: Nu! ARTHUR: No. Ni! More like this. "Ni"! BEDEVERE: Ni, ni, ni! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///