mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.1225: no check for spell region being zero
Problem: No check for spell region being zero. (geeknik) Solution: Check for zero. (closes #2252)
This commit is contained in:
parent
cf1ba35fc2
commit
ee03b94124
@ -4277,7 +4277,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
flags |= WF_REGION;
|
flags |= WF_REGION;
|
||||||
|
|
||||||
l = *p - '0';
|
l = *p - '0';
|
||||||
if (l > spin->si_region_count)
|
if (l == 0 || l > spin->si_region_count)
|
||||||
{
|
{
|
||||||
smsg((char_u *)_("Invalid region nr in %s line %d: %s"),
|
smsg((char_u *)_("Invalid region nr in %s line %d: %s"),
|
||||||
fname, lnum, p);
|
fname, lnum, p);
|
||||||
|
@ -271,6 +271,15 @@ func Test_zz_sal_and_addition()
|
|||||||
call assert_equal("elekwint", SecondSpellWord())
|
call assert_equal("elekwint", SecondSpellWord())
|
||||||
endfunc
|
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).
|
" Check using z= in new buffer (crash fixed by patch 7.4a.028).
|
||||||
func Test_zeq_crash()
|
func Test_zeq_crash()
|
||||||
new
|
new
|
||||||
|
@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1225,
|
||||||
/**/
|
/**/
|
||||||
1224,
|
1224,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user