Patch 8.1.2268
Problem: Spell file flag zero is not recognized.
Solution: Use -1 as an error value, so that zero can be used as a valid flag
number.
Files: src/spellfile.c, src/testdir/test_spell.vim
*** ../vim-8.1.2267/src/spellfile.c 2019-08-11 22:50:53.828345974 +0200
--- src/spellfile.c 2019-11-07 20:47:49.297406026 +0100
***************
*** 260,265 ****
--- 260,267 ----
* follow; never used in prefix tree */
#define BY_SPECIAL BY_FLAGS2 /* highest special byte value */
+ #define ZERO_FLAG 65009 // used when flag is zero: "0"
+
/* Flags used in .spl file for soundsalike flags. */
#define SAL_F0LLOWUP 1
#define SAL_COLLAPSE 2
***************
*** 3182,3187 ****
--- 3184,3190 ----
/*
* Get one affix name from "*pp" and advance the pointer.
+ * Returns ZERO_FLAG for "0".
* Returns zero for an error, still advances the pointer then.
*/
static unsigned
***************
*** 3197,3202 ****
--- 3200,3207 ----
return 0;
}
res = getdigits(pp);
+ if (res == 0)
+ res = ZERO_FLAG;
}
else
{
***************
*** 3343,3348 ****
--- 3348,3355 ----
for (p = afflist; *p != NUL; )
{
n = getdigits(&p);
+ if (n == 0)
+ n = ZERO_FLAG;
if (n == flag)
return TRUE;
if (*p != NUL) /* skip over comma */
*** ../vim-8.1.2267/src/testdir/test_spell.vim 2019-10-18 20:36:48.753171724
+0200
--- src/testdir/test_spell.vim 2019-11-07 20:47:10.857555418 +0100
***************
*** 290,298 ****
\ ])
call LoadAffAndDic(g:test_data_aff7, g:test_data_dic7)
! call RunGoodBad("meea1 meea\xE9 bar prebar barmeat prebarmeat leadprebar
lead tail leadtail leadmiddletail",
\ "bad: mee meea2 prabar probarmaat middle leadmiddle middletail
taillead leadprobar",
! \ ["bar", "barmeat", "lead", "meea1", "meea\xE9", "prebar",
"prebarmeat", "tail"],
\ [
\ ["bad", ["bar", "lead", "tail"]],
\ ["mee", ["meea1", "meea\xE9", "bar"]],
--- 290,298 ----
\ ])
call LoadAffAndDic(g:test_data_aff7, g:test_data_dic7)
! call RunGoodBad("meea1 meezero meea\xE9 bar prebar barmeat prebarmeat
leadprebar lead tail leadtail leadmiddletail",
\ "bad: mee meea2 prabar probarmaat middle leadmiddle middletail
taillead leadprobar",
! \ ["bar", "barmeat", "lead", "meea1", "meea\xE9", "meezero",
"prebar", "prebarmeat", "tail"],
\ [
\ ["bad", ["bar", "lead", "tail"]],
\ ["mee", ["meea1", "meea\xE9", "bar"]],
***************
*** 746,751 ****
--- 746,754 ----
\"SFX 61003 Y 1",
\"SFX 61003 0 meat .",
\"",
+ \"SFX 0 Y 1",
+ \"SFX 0 0 zero .",
+ \"",
\"SFX 391 Y 1",
\"SFX 391 0 a1 .",
\"",
***************
*** 757,763 ****
\ ]
let g:test_data_dic7 = [
\"1234",
! \"mee/391,111,9999",
\"bar/17,61003,123",
\"lead/2",
\"tail/123",
--- 760,766 ----
\ ]
let g:test_data_dic7 = [
\"1234",
! \"mee/0,391,111,9999",
\"bar/17,61003,123",
\"lead/2",
\"tail/123",
*** ../vim-8.1.2267/src/version.c 2019-11-06 23:26:16.973911982 +0100
--- src/version.c 2019-11-07 20:33:35.432656722 +0100
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 2268,
/**/
--
Bumper sticker: Honk if you love peace and quiet.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201911071949.xA7JnE8V002645%40masaka.moolenaar.net.