From 8e9e3b313d2d250dd0f0c754e331a279567e9ff9 Mon Sep 17 00:00:00 2001 From: shixuantong <1726671442@qq.com> Date: Wed, 29 Jun 2022 19:21:20 +0800 Subject: [PATCH] fix CVE-2022-2126 --- backport-CVE-2022-2126.patch | 51 + ...-patch-8.2.1354-test-59-is-old-style.patch | 1813 +++++++++++++++++ ...rash-when-going-through-spell-sugges.patch | 72 + ...pell-suggestion-may-use-uninitialize.patch | 95 + vim.spec | 12 +- 5 files changed, 2042 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2022-2126.patch create mode 100644 backport-patch-8.2.1354-test-59-is-old-style.patch create mode 100644 backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch create mode 100644 backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch diff --git a/backport-CVE-2022-2126.patch b/backport-CVE-2022-2126.patch new file mode 100644 index 0000000..33196f5 --- /dev/null +++ b/backport-CVE-2022-2126.patch @@ -0,0 +1,51 @@ +From 156d3911952d73b03d7420dc3540215247db0fe8 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sat, 18 Jun 2022 14:09:08 +0100 +Subject: [PATCH] patch 8.2.5123: using invalid index when looking for spell + suggestions + +Problem: Using invalid index when looking for spell suggestions. +Solution: Do not decrement the index when it is zero. +--- + src/spellsuggest.c | 3 ++- + src/testdir/test_spell.vim | 10 ++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/spellsuggest.c b/src/spellsuggest.c +index 2b7d13b..379d9ba 100644 +--- a/src/spellsuggest.c ++++ b/src/spellsuggest.c +@@ -1944,7 +1944,8 @@ suggest_trie_walk( + sp->ts_isdiff = (newscore != 0) + ? DIFF_YES : DIFF_NONE; + } +- else if (sp->ts_isdiff == DIFF_INSERT) ++ else if (sp->ts_isdiff == DIFF_INSERT ++ && sp->ts_fidx > 0) + // When inserting trail bytes don't advance in the + // bad word. + --sp->ts_fidx; +diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim +index c09137a..b6117aa 100644 +--- a/src/testdir/test_spell.vim ++++ b/src/testdir/test_spell.vim +@@ -70,6 +70,16 @@ func Test_z_equal_on_invalid_utf8_word() + bwipe! + endfunc + ++func Test_z_equal_on_single_character() ++ " this was decrementing the index below zero ++ new ++ norm a0\Ê ++ norm zW ++ norm z= ++ ++ bwipe! ++endfunc ++ + " Test spellbadword() with argument + func Test_spellbadword() + set spell +-- +1.8.3.1 + diff --git a/backport-patch-8.2.1354-test-59-is-old-style.patch b/backport-patch-8.2.1354-test-59-is-old-style.patch new file mode 100644 index 0000000..84112b9 --- /dev/null +++ b/backport-patch-8.2.1354-test-59-is-old-style.patch @@ -0,0 +1,1813 @@ +From aa970abd0a987de96321d33db82f70bbceac931b Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sun, 2 Aug 2020 16:10:39 +0200 +Subject: [PATCH] patch 8.2.1354: test 59 is old style + +Problem: Test 59 is old style. +Solution: Convert into a new style test. (Yegappan Lakshmanan, closes #6604) +--- + src/Makefile | 2 +- + src/testdir/Make_all.mak | 3 +- + src/testdir/Make_vms.mms | 29 +- + src/testdir/test59.in | 626 -------------------------------- + src/testdir/test59.ok | 270 -------------- + src/testdir/test_spell_utf8.vim | 768 ++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 772 insertions(+), 926 deletions(-) + delete mode 100644 src/testdir/test59.in + delete mode 100644 src/testdir/test59.ok + create mode 100644 src/testdir/test_spell_utf8.vim + +diff --git a/src/Makefile b/src/Makefile +index 1493ea7..1207596 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -2254,7 +2254,7 @@ test_libvterm: + test1 \ + test_eval \ + test42 test44 test49 \ +- test52 test59 \ ++ test52 \ + test64 test69 \ + test70 test72 \ + test86 test87 \ +diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak +index e608b92..2a3c4ab 100644 +--- a/src/testdir/Make_all.mak ++++ b/src/testdir/Make_all.mak +@@ -37,7 +37,6 @@ SCRIPTS_MORE2 = \ + + # Tests that run on most systems, but not on VMS + SCRIPTS_MORE4 = \ +- test59.out \ + test72.out \ + + +@@ -238,6 +237,7 @@ NEW_TESTS = \ + test_source \ + test_source_utf8 \ + test_spell \ ++ test_spell_utf8 \ + test_spellfile \ + test_startup \ + test_startup_utf8 \ +@@ -420,6 +420,7 @@ NEW_TESTS_RES = \ + test_sound.res \ + test_source.res \ + test_spell.res \ ++ test_spell_utf8.res \ + test_spellfile.res \ + test_startup.res \ + test_stat.res \ +diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms +index e31060b..eb6fd11 100644 +--- a/src/testdir/Make_vms.mms ++++ b/src/testdir/Make_vms.mms +@@ -32,22 +32,6 @@ + # and directory handling. + # WANT_UNIX = YES + +-# Comment out if you want to run Win32 specific tests as well, but please +-# be aware, that on OpenVMS will fail, because of cat, rm, etc commands +-# and directory handling. +-# WANT_WIN = YES +- +-# Comment out if you want to run spell checker tests. +-# They fail because VMS does not support file names. +-# WANT_SPELL = YES +- +-# Comment out if you want to run mzschema tests. +-# It fails because VMS does not support this feature yet. +-# WANT_MZSCH = YES +- +-# Comment out if you have ODS-5 file system +-# HAVE_ODS5 = YES +- + # Comment out if you have gzip on your system + # HAVE_GZIP = YES + +@@ -82,9 +66,6 @@ SCRIPT = test1.out \ + + # Known problems: + # +-# test59: Failed/Hangs - VMS does not support spell files (file names +-# with too many dots). +-# + # test72: bug - Vim hangs at :rename (while rename works well otherwise) + # test78: bug - Vim dies at :recover Xtest + # test89: bug - findfile() does not work on VMS (just in the current directory) +@@ -104,10 +85,6 @@ SCRIPT_UNIX = test10.out test27.out test49.out + SCRIPT_WIN = test52.out + .ENDIF + +-.IFDEF WANT_SPELL +-SCRIPT_SPELL = test59.out +-.ENDIF +- + .IFDEF WANT_MZSCH + SCRIPT_MZSCH = test70.out + .ENDIF +@@ -144,7 +121,7 @@ SCRIPT_PYTHON = test86.out test87.out + -@ if "''F$SEARCH("Xdotest.*")'" .NES. "" then delete/noconfirm/nolog Xdotest.*.* + -@ if "''F$SEARCH("Xtest.*")'" .NES. "" then delete/noconfirm/nolog Xtest.*.* + +-all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_ODS5) \ ++all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_ODS5) \ + $(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog + -@ write sys$output " " + -@ write sys$output "-----------------------------------------------" +@@ -170,10 +147,6 @@ nolog : + -@ write sys$output "MAKE_VMS.MMS options:" + -@ write sys$output " WANT_GUI = ""$(WANT_GUI)"" " + -@ write sys$output " WANT_UNIX = ""$(WANT_UNIX)"" " +- -@ write sys$output " WANT_WIN = ""$(WANT_WIN)"" " +- -@ write sys$output " WANT_SPELL = ""$(WANT_SPELL)"" " +- -@ write sys$output " WANT_MZSCH = ""$(WANT_MZSCH)"" " +- -@ write sys$output " HAVE_ODS5 = ""$(HAVE_ODS5)"" " + -@ write sys$output " HAVE_GZIP = ""$(HAVE_GZIP)"" " + -@ write sys$output " HAVE_GDIFF = ""$(HAVE_GDIFF)"" " + -@ write sys$output " HAVE_ICONV = ""$(HAVE_ICONV)"" " +diff --git a/src/testdir/test59.in b/src/testdir/test59.in +deleted file mode 100644 +index dcdb62b..0000000 +--- a/src/testdir/test59.in ++++ /dev/null +@@ -1,626 +0,0 @@ +-Tests for spell checking with 'encoding' set to "utf-8". vim: set ft=vim : +- +-STARTTEST +-:so small.vim +-:so mbyte.vim +-:" +-:" Don't want to depend on the locale from the environment. The .aff and .dic +-:" text is in latin1, the test text is utf-8. +-:set enc=latin1 +-:e! +-:set enc=utf-8 +-:set fenc= +-:" +-:" Function to test .aff/.dic with list of good and bad words. +-:func TestOne(aff, dic) +- set spellfile= +- $put ='' +- $put ='test '. a:aff . '-' . a:dic +- " Generate a .spl file from a .dic and .aff file. +- exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff' +- exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic' +- mkspell! Xtest Xtest +- " use that spell file +- set spl=Xtest.utf-8.spl spell +- " list all valid words +- spelldump +- %yank +- quit +- $put +- $put ='-------' +- " find all bad words and suggestions for them +- exe '1;/^' . a:aff . 'good:' +- normal 0f:]s +- let prevbad = '' +- while 1 +- let [bad, a] = spellbadword() +- if bad == '' || bad == prevbad || bad == 'badend' +- break +- endif +- let prevbad = bad +- let lst = spellsuggest(bad, 3) +- normal mm +- $put =bad +- $put =string(lst) +- normal `m]s +- endwhile +-endfunc +-:" +-:call TestOne('1', '1') +-:$put =soundfold('goobledygoook') +-:$put =soundfold('kóopërÿnôven') +-:$put =soundfold('oeverloos gezwets edale') +-:" +-:" +-:" and now with SAL instead of SOFO items; test automatic reloading +-gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff +-:mkspell! Xtest Xtest +-:$put =soundfold('goobledygoook') +-:$put =soundfold('kóopërÿnôven') +-:$put =soundfold('oeverloos gezwets edale') +-:" +-:" also use an addition file +-gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add +-:mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add +-:set spellfile=Xtest.utf-8.add +-/^test2: +-]s:let [str, a] = spellbadword() +-:$put =str +-:set spl=Xtest_us.utf-8.spl +-/^test2: +-]smm:let [str, a] = spellbadword() +-:$put =str +-`m]s:let [str, a] = spellbadword() +-:$put =str +-:set spl=Xtest_gb.utf-8.spl +-/^test2: +-]smm:let [str, a] = spellbadword() +-:$put =str +-`m]s:let [str, a] = spellbadword() +-:$put =str +-:set spl=Xtest_nz.utf-8.spl +-/^test2: +-]smm:let [str, a] = spellbadword() +-:$put =str +-`m]s:let [str, a] = spellbadword() +-:$put =str +-:set spl=Xtest_ca.utf-8.spl +-/^test2: +-]smm:let [str, a] = spellbadword() +-:$put =str +-`m]s:let [str, a] = spellbadword() +-:$put =str +-:unlet str a +-:" +-:" Postponed prefixes +-:call TestOne('2', '1') +-:" +-:" Compound words +-:call TestOne('3', '3') +-:call TestOne('4', '4') +-:call TestOne('5', '5') +-:call TestOne('6', '6') +-:call TestOne('7', '7') +-:" +-:" clean up for valgrind +-:delfunc TestOne +-:set spl= enc=latin1 +-:" +-gg:/^test output:/,$wq! test.out +-ENDTEST +- +-1affstart +-SET ISO8859-1 +-TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ +- +-FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ +- +-SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ +-SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? +- +-MIDWORD '- +- +-KEP = +-RAR ? +-BAD ! +- +-#NOSPLITSUGS +- +-PFX I N 1 +-PFX I 0 in . +- +-PFX O Y 1 +-PFX O 0 out . +- +-SFX S Y 2 +-SFX S 0 s [^s] +-SFX S 0 es s +- +-SFX N N 3 +-SFX N 0 en [^n] +-SFX N 0 nen n +-SFX N 0 n . +- +-REP 3 +-REP g ch +-REP ch g +-REP svp s.v.p. +- +-MAP 9 +-MAP aàáâãäå +-MAP eèéêë +-MAP iìíîï +-MAP oòóôõö +-MAP uùúûü +-MAP nñ +-MAP cç +-MAP yÿý +-MAP sß +-1affend +- +-affstart_sal +-SET ISO8859-1 +-TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ +- +-FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ +- +-MIDWORD '- +- +-KEP = +-RAR ? +-BAD ! +- +-#NOSPLITSUGS +- +-PFX I N 1 +-PFX I 0 in . +- +-PFX O Y 1 +-PFX O 0 out . +- +-SFX S Y 2 +-SFX S 0 s [^s] +-SFX S 0 es s +- +-SFX N N 3 +-SFX N 0 en [^n] +-SFX N 0 nen n +-SFX N 0 n . +- +-REP 3 +-REP g ch +-REP ch g +-REP svp s.v.p. +- +-MAP 9 +-MAP aàáâãäå +-MAP eèéêë +-MAP iìíîï +-MAP oòóôõö +-MAP uùúûü +-MAP nñ +-MAP cç +-MAP yÿý +-MAP sß +- +-SAL AH(AEIOUY)-^ *H +-SAL AR(AEIOUY)-^ *R +-SAL A(HR)^ * +-SAL A^ * +-SAL AH(AEIOUY)- H +-SAL AR(AEIOUY)- R +-SAL A(HR) _ +-SAL À^ * +-SAL Å^ * +-SAL BB- _ +-SAL B B +-SAL CQ- _ +-SAL CIA X +-SAL CH X +-SAL C(EIY)- S +-SAL CK K +-SAL COUGH^ KF +-SAL CC< C +-SAL C K +-SAL DG(EIY) K +-SAL DD- _ +-SAL D T +-SAL É< E +-SAL EH(AEIOUY)-^ *H +-SAL ER(AEIOUY)-^ *R +-SAL E(HR)^ * +-SAL ENOUGH^$ *NF +-SAL E^ * +-SAL EH(AEIOUY)- H +-SAL ER(AEIOUY)- R +-SAL E(HR) _ +-SAL FF- _ +-SAL F F +-SAL GN^ N +-SAL GN$ N +-SAL GNS$ NS +-SAL GNED$ N +-SAL GH(AEIOUY)- K +-SAL GH _ +-SAL GG9 K +-SAL G K +-SAL H H +-SAL IH(AEIOUY)-^ *H +-SAL IR(AEIOUY)-^ *R +-SAL I(HR)^ * +-SAL I^ * +-SAL ING6 N +-SAL IH(AEIOUY)- H +-SAL IR(AEIOUY)- R +-SAL I(HR) _ +-SAL J K +-SAL KN^ N +-SAL KK- _ +-SAL K K +-SAL LAUGH^ LF +-SAL LL- _ +-SAL L L +-SAL MB$ M +-SAL MM M +-SAL M M +-SAL NN- _ +-SAL N N +-SAL OH(AEIOUY)-^ *H +-SAL OR(AEIOUY)-^ *R +-SAL O(HR)^ * +-SAL O^ * +-SAL OH(AEIOUY)- H +-SAL OR(AEIOUY)- R +-SAL O(HR) _ +-SAL PH F +-SAL PN^ N +-SAL PP- _ +-SAL P P +-SAL Q K +-SAL RH^ R +-SAL ROUGH^ RF +-SAL RR- _ +-SAL R R +-SAL SCH(EOU)- SK +-SAL SC(IEY)- S +-SAL SH X +-SAL SI(AO)- X +-SAL SS- _ +-SAL S S +-SAL TI(AO)- X +-SAL TH @ +-SAL TCH-- _ +-SAL TOUGH^ TF +-SAL TT- _ +-SAL T T +-SAL UH(AEIOUY)-^ *H +-SAL UR(AEIOUY)-^ *R +-SAL U(HR)^ * +-SAL U^ * +-SAL UH(AEIOUY)- H +-SAL UR(AEIOUY)- R +-SAL U(HR) _ +-SAL V^ W +-SAL V F +-SAL WR^ R +-SAL WH^ W +-SAL W(AEIOU)- W +-SAL X^ S +-SAL X KS +-SAL Y(AEIOU)- Y +-SAL ZZ- _ +-SAL Z S +-affend_sal +- +-2affstart +-SET ISO8859-1 +- +-FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ +- +-PFXPOSTPONE +- +-MIDWORD '- +- +-KEP = +-RAR ? +-BAD ! +- +-#NOSPLITSUGS +- +-PFX I N 1 +-PFX I 0 in . +- +-PFX O Y 1 +-PFX O 0 out [a-z] +- +-SFX S Y 2 +-SFX S 0 s [^s] +-SFX S 0 es s +- +-SFX N N 3 +-SFX N 0 en [^n] +-SFX N 0 nen n +-SFX N 0 n . +- +-REP 3 +-REP g ch +-REP ch g +-REP svp s.v.p. +- +-MAP 9 +-MAP aàáâãäå +-MAP eèéêë +-MAP iìíîï +-MAP oòóôõö +-MAP uùúûü +-MAP nñ +-MAP cç +-MAP yÿý +-MAP sß +-2affend +- +-1dicstart +-123456 +-test/NO +-# comment +-wrong +-Comment +-OK +-uk +-put/ISO +-the end +-deol +-déôr +-1dicend +- +-addstart +-/regions=usgbnz +-elequint/2 +-elekwint/3 +-addend +- +-1good: wrong OK puts. Test the end +-bad: inputs comment ok Ok. test déôl end the +-badend +- +-2good: puts +-bad: inputs comment ok Ok end the. test déôl +-badend +- +-Test rules for compounding. +- +-3affstart +-SET ISO8859-1 +- +-COMPOUNDMIN 3 +-COMPOUNDRULE m* +-NEEDCOMPOUND x +-3affend +- +-3dicstart +-1234 +-foo/m +-bar/mx +-mï/m +-la/mx +-3dicend +- +-3good: foo mï foobar foofoobar barfoo barbarfoo +-bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar +-badend +- +- +-Tests for compounding. +- +-4affstart +-SET ISO8859-1 +- +-FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ +- +-COMPOUNDRULE m+ +-COMPOUNDRULE sm*e +-COMPOUNDRULE sm+ +-COMPOUNDMIN 3 +-COMPOUNDWORDMAX 3 +-COMPOUNDFORBIDFLAG t +- +-COMPOUNDSYLMAX 5 +-SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui +- +-MAP 9 +-MAP aàáâãäå +-MAP eèéêë +-MAP iìíîï +-MAP oòóôõö +-MAP uùúûü +-MAP nñ +-MAP cç +-MAP yÿý +-MAP sß +- +-NEEDAFFIX x +- +-PFXPOSTPONE +- +-MIDWORD '- +- +-SFX q N 1 +-SFX q 0 -ok . +- +-SFX a Y 2 +-SFX a 0 s . +-SFX a 0 ize/t . +- +-PFX p N 1 +-PFX p 0 pre . +- +-PFX P N 1 +-PFX P 0 nou . +-4affend +- +-4dicstart +-1234 +-word/mP +-util/am +-pro/xq +-tomato/m +-bork/mp +-start/s +-end/e +-4dicend +- +-4good: word util bork prebork start end wordutil wordutils pro-ok +- bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork +- tomato tomatotomato startend startword startwordword startwordend +- startwordwordend startwordwordwordend prebork preborkbork +- preborkborkbork +- nouword +-bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato +- endstart endend startstart wordend wordstart +- preborkprebork preborkpreborkbork +- startwordwordwordwordend borkpreborkpreborkbork +- utilsbork startnouword +-badend +- +-test2: +-elequint test elekwint test elekwent asdf +- +-Test affix flags with two characters +- +-5affstart +-SET ISO8859-1 +- +-FLAG long +- +-NEEDAFFIX !! +- +-COMPOUNDRULE ssmm*ee +- +-NEEDCOMPOUND xx +-COMPOUNDPERMITFLAG pp +- +-SFX 13 Y 1 +-SFX 13 0 bork . +- +-SFX a1 Y 1 +-SFX a1 0 a1 . +- +-SFX aé Y 1 +-SFX aé 0 aé . +- +-PFX zz Y 1 +-PFX zz 0 pre/pp . +- +-PFX yy Y 1 +-PFX yy 0 nou . +-5affend +- +-5dicstart +-1234 +-foo/a1aé!! +-bar/zz13ee +-start/ss +-end/eeyy +-middle/mmxx +-5dicend +- +-5good: fooa1 fooaé bar prebar barbork prebarbork startprebar +- start end startend startmiddleend nouend +-bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart +- startprobar startnouend +-badend +- +-6affstart +-SET ISO8859-1 +- +-FLAG caplong +- +-NEEDAFFIX A! +- +-COMPOUNDRULE sMm*Ee +- +-NEEDCOMPOUND Xx +- +-COMPOUNDPERMITFLAG p +- +-SFX N3 Y 1 +-SFX N3 0 bork . +- +-SFX A1 Y 1 +-SFX A1 0 a1 . +- +-SFX Aé Y 1 +-SFX Aé 0 aé . +- +-PFX Zz Y 1 +-PFX Zz 0 pre/p . +-6affend +- +-6dicstart +-1234 +-mee/A1AéA! +-bar/ZzN3Ee +-lead/s +-end/Ee +-middle/MmXx +-6dicend +- +-6good: meea1 meeaé bar prebar barbork prebarbork leadprebar +- lead end leadend leadmiddleend +-bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead +- leadprobar +-badend +- +-7affstart +-SET ISO8859-1 +- +-FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +-UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ +- +-FLAG num +- +-NEEDAFFIX 9999 +- +-COMPOUNDRULE 2,77*123 +- +-NEEDCOMPOUND 1 +-COMPOUNDPERMITFLAG 432 +- +-SFX 61003 Y 1 +-SFX 61003 0 meat . +- +-SFX 391 Y 1 +-SFX 391 0 a1 . +- +-SFX 111 Y 1 +-SFX 111 0 aé . +- +-PFX 17 Y 1 +-PFX 17 0 pre/432 . +-7affend +- +-7dicstart +-1234 +-mee/391,111,9999 +-bar/17,61003,123 +-lead/2 +-tail/123 +-middle/77,1 +-7dicend +- +-7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar +- lead tail leadtail leadmiddletail +-bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead +- leadprobar +-badend +- +-test output: +diff --git a/src/testdir/test59.ok b/src/testdir/test59.ok +deleted file mode 100644 +index 931cdd9..0000000 +--- a/src/testdir/test59.ok ++++ /dev/null +@@ -1,270 +0,0 @@ +-test output: +- +-test 1-1 +-# file: Xtest.utf-8.spl +-Comment +-deol +-déôr +-input +-OK +-output +-outputs +-outtest +-put +-puts +-test +-testen +-testn +-the end +-uk +-wrong +-------- +-bad +-['put', 'uk', 'OK'] +-inputs +-['input', 'puts', 'outputs'] +-comment +-['Comment', 'outtest', 'the end'] +-ok +-['OK', 'uk', 'put'] +-Ok +-['OK', 'Uk', 'Put'] +-test +-['Test', 'testn', 'testen'] +-déôl +-['deol', 'déôr', 'test'] +-end +-['put', 'uk', 'test'] +-the +-['put', 'uk', 'test'] +-gebletegek +-kepereneven +-everles gesvets etele +-kbltykk +-kprnfn +-*fls kswts tl +-elekwent +-elequint +-elekwint +-elekwint +-elekwent +-elequint +-elekwent +-elequint +-elekwint +- +-test 2-1 +-# file: Xtest.utf-8.spl +-Comment +-deol +-déôr +-OK +-put +-input +-output +-puts +-outputs +-test +-outtest +-testen +-testn +-the end +-uk +-wrong +-------- +-bad +-['put', 'uk', 'OK'] +-inputs +-['input', 'puts', 'outputs'] +-comment +-['Comment'] +-ok +-['OK', 'uk', 'put'] +-Ok +-['OK', 'Uk', 'Put'] +-end +-['put', 'uk', 'deol'] +-the +-['put', 'uk', 'test'] +-test +-['Test', 'testn', 'testen'] +-déôl +-['deol', 'déôr', 'test'] +- +-test 3-3 +-# file: Xtest.utf-8.spl +-foo +-mï +-------- +-bad +-['foo', 'mï'] +-bar +-['barfoo', 'foobar', 'foo'] +-la +-['mï', 'foo'] +-foomï +-['foo mï', 'foo', 'foofoo'] +-barmï +-['barfoo', 'mï', 'barbar'] +-mïfoo +-['mï foo', 'foo', 'foofoo'] +-mïbar +-['foobar', 'barbar', 'mï'] +-mïmï +-['mï mï', 'mï'] +-lala +-[] +-mïla +-['mï', 'mï mï'] +-lamï +-['mï', 'mï mï'] +-foola +-['foo', 'foobar', 'foofoo'] +-labar +-['barbar', 'foobar'] +- +-test 4-4 +-# file: Xtest.utf-8.spl +-bork +-prebork +-end +-pro-ok +-start +-tomato +-util +-utilize +-utils +-word +-nouword +-------- +-bad +-['end', 'bork', 'word'] +-wordutilize +-['word utilize', 'wordutils', 'wordutil'] +-pro +-['bork', 'word', 'end'] +-borkborkborkborkborkbork +-['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork'] +-tomatotomatotomato +-['tomato tomatotomato', 'tomatotomato tomato', 'tomato tomato tomato'] +-endstart +-['end start', 'start'] +-endend +-['end end', 'end'] +-startstart +-['start start'] +-wordend +-['word end', 'word', 'wordword'] +-wordstart +-['word start', 'bork start'] +-preborkprebork +-['prebork prebork', 'preborkbork', 'preborkborkbork'] +-preborkpreborkbork +-['prebork preborkbork', 'preborkborkbork', 'preborkborkborkbork'] +-startwordwordwordwordend +-['startwordwordwordword end', 'startwordwordwordword', 'start wordwordwordword end'] +-borkpreborkpreborkbork +-['bork preborkpreborkbork', 'bork prebork preborkbork', 'bork preborkprebork bork'] +-utilsbork +-['utilbork', 'utils bork', 'util bork'] +-startnouword +-['start nouword', 'startword', 'startborkword'] +- +-test 5-5 +-# file: Xtest.utf-8.spl +-bar +-barbork +-end +-fooa1 +-fooaé +-nouend +-prebar +-prebarbork +-start +-------- +-bad +-['bar', 'end', 'fooa1'] +-foo +-['fooa1', 'fooaé', 'bar'] +-fooa2 +-['fooa1', 'fooaé', 'bar'] +-prabar +-['prebar', 'bar', 'bar bar'] +-probarbirk +-['prebarbork'] +-middle +-[] +-startmiddle +-['startmiddleend', 'startmiddlebar'] +-middleend +-[] +-endstart +-['end start', 'start'] +-startprobar +-['startprebar', 'start prebar', 'startbar'] +-startnouend +-['start nouend', 'startend'] +- +-test 6-6 +-# file: Xtest.utf-8.spl +-bar +-barbork +-end +-lead +-meea1 +-meeaé +-prebar +-prebarbork +-------- +-bad +-['bar', 'end', 'lead'] +-mee +-['meea1', 'meeaé', 'bar'] +-meea2 +-['meea1', 'meeaé', 'lead'] +-prabar +-['prebar', 'bar', 'leadbar'] +-probarbirk +-['prebarbork'] +-middle +-[] +-leadmiddle +-['leadmiddleend', 'leadmiddlebar'] +-middleend +-[] +-endlead +-['end lead', 'lead', 'end end'] +-leadprobar +-['leadprebar', 'lead prebar', 'leadbar'] +- +-test 7-7 +-# file: Xtest.utf-8.spl +-bar +-barmeat +-lead +-meea1 +-meeaé +-prebar +-prebarmeat +-tail +-------- +-bad +-['bar', 'lead', 'tail'] +-mee +-['meea1', 'meeaé', 'bar'] +-meea2 +-['meea1', 'meeaé', 'lead'] +-prabar +-['prebar', 'bar', 'leadbar'] +-probarmaat +-['prebarmeat'] +-middle +-[] +-leadmiddle +-['leadmiddlebar'] +-middletail +-[] +-taillead +-['tail lead', 'tail'] +-leadprobar +-['leadprebar', 'lead prebar', 'leadbar'] +diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim +new file mode 100644 +index 0000000..1f561e4 +--- /dev/null ++++ b/src/testdir/test_spell_utf8.vim +@@ -0,0 +1,768 @@ ++" Test for spell checking with 'encoding' set to utf-8 ++ ++source check.vim ++CheckFeature spell ++ ++scriptencoding utf-8 ++ ++func TearDown() ++ set nospell ++ call delete('Xtest.aff') ++ call delete('Xtest.dic') ++ call delete('Xtest.utf-8.add') ++ call delete('Xtest.utf-8.add.spl') ++ call delete('Xtest.utf-8.spl') ++ call delete('Xtest.utf-8.sug') ++endfunc ++ ++let g:test_data_aff1 = [ ++ \"SET ISO8859-1", ++ \"TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ", ++ \"", ++ \"FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ", ++ \"LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ", ++ \"UPP ÀÃÂÃÄÅÆÇÈÉÊËÌÃÃŽÃÃÑÒÓÔÕÖØÙÚÛÜÃÞßÿ", ++ \"", ++ \"SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xBF", ++ \"SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?", ++ \"", ++ \"MIDWORD\t'-", ++ \"", ++ \"KEP =", ++ \"RAR ?", ++ \"BAD !", ++ \"", ++ \"PFX I N 1", ++ \"PFX I 0 in .", ++ \"", ++ \"PFX O Y 1", ++ \"PFX O 0 out .", ++ \"", ++ \"SFX S Y 2", ++ \"SFX S 0 s [^s]", ++ \"SFX S 0 es s", ++ \"", ++ \"SFX N N 3", ++ \"SFX N 0 en [^n]", ++ \"SFX N 0 nen n", ++ \"SFX N 0 n .", ++ \"", ++ \"REP 3", ++ \"REP g ch", ++ \"REP ch g", ++ \"REP svp s.v.p.", ++ \"", ++ \"MAP 9", ++ \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", ++ \"MAP e\xE8\xE9\xEA\xEB", ++ \"MAP i\xEC\xED\xEE\xEF", ++ \"MAP o\xF2\xF3\xF4\xF5\xF6", ++ \"MAP u\xF9\xFA\xFB\xFC", ++ \"MAP n\xF1", ++ \"MAP c\xE7", ++ \"MAP y\xFF\xFD", ++ \"MAP s\xDF" ++ \ ] ++let g:test_data_dic1 = [ ++ \"123456", ++ \"test/NO", ++ \"# comment", ++ \"wrong", ++ \"Comment", ++ \"OK", ++ \"uk", ++ \"put/ISO", ++ \"the end", ++ \"deol", ++ \"d\xE9\xF4r", ++ \ ] ++let g:test_data_aff2 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"FOL \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"LOW \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"UPP \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF", ++ \"", ++ \"PFXPOSTPONE", ++ \"", ++ \"MIDWORD\t'-", ++ \"", ++ \"KEP =", ++ \"RAR ?", ++ \"BAD !", ++ \"", ++ \"PFX I N 1", ++ \"PFX I 0 in .", ++ \"", ++ \"PFX O Y 1", ++ \"PFX O 0 out [a-z]", ++ \"", ++ \"SFX S Y 2", ++ \"SFX S 0 s [^s]", ++ \"SFX S 0 es s", ++ \"", ++ \"SFX N N 3", ++ \"SFX N 0 en [^n]", ++ \"SFX N 0 nen n", ++ \"SFX N 0 n .", ++ \"", ++ \"REP 3", ++ \"REP g ch", ++ \"REP ch g", ++ \"REP svp s.v.p.", ++ \"", ++ \"MAP 9", ++ \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", ++ \"MAP e\xE8\xE9\xEA\xEB", ++ \"MAP i\xEC\xED\xEE\xEF", ++ \"MAP o\xF2\xF3\xF4\xF5\xF6", ++ \"MAP u\xF9\xFA\xFB\xFC", ++ \"MAP n\xF1", ++ \"MAP c\xE7", ++ \"MAP y\xFF\xFD", ++ \"MAP s\xDF", ++ \ ] ++let g:test_data_aff3 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"COMPOUNDMIN 3", ++ \"COMPOUNDRULE m*", ++ \"NEEDCOMPOUND x", ++ \ ] ++let g:test_data_dic3 = [ ++ \"1234", ++ \"foo/m", ++ \"bar/mx", ++ \"m\xEF/m", ++ \"la/mx", ++ \ ] ++let g:test_data_aff4 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"FOL \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"LOW \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"UPP \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF", ++ \"", ++ \"COMPOUNDRULE m+", ++ \"COMPOUNDRULE sm*e", ++ \"COMPOUNDRULE sm+", ++ \"COMPOUNDMIN 3", ++ \"COMPOUNDWORDMAX 3", ++ \"COMPOUNDFORBIDFLAG t", ++ \"", ++ \"COMPOUNDSYLMAX 5", ++ \"SYLLABLE a\xE1e\xE9i\xEDo\xF3\xF6\xF5u\xFA\xFC\xFBy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui", ++ \"", ++ \"MAP 9", ++ \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", ++ \"MAP e\xE8\xE9\xEA\xEB", ++ \"MAP i\xEC\xED\xEE\xEF", ++ \"MAP o\xF2\xF3\xF4\xF5\xF6", ++ \"MAP u\xF9\xFA\xFB\xFC", ++ \"MAP n\xF1", ++ \"MAP c\xE7", ++ \"MAP y\xFF\xFD", ++ \"MAP s\xDF", ++ \"", ++ \"NEEDAFFIX x", ++ \"", ++ \"PFXPOSTPONE", ++ \"", ++ \"MIDWORD '-", ++ \"", ++ \"SFX q N 1", ++ \"SFX q 0 -ok .", ++ \"", ++ \"SFX a Y 2", ++ \"SFX a 0 s .", ++ \"SFX a 0 ize/t .", ++ \"", ++ \"PFX p N 1", ++ \"PFX p 0 pre .", ++ \"", ++ \"PFX P N 1", ++ \"PFX P 0 nou .", ++ \ ] ++let g:test_data_dic4 = [ ++ \"1234", ++ \"word/mP", ++ \"util/am", ++ \"pro/xq", ++ \"tomato/m", ++ \"bork/mp", ++ \"start/s", ++ \"end/e", ++ \ ] ++let g:test_data_aff5 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"FLAG long", ++ \"", ++ \"NEEDAFFIX !!", ++ \"", ++ \"COMPOUNDRULE ssmm*ee", ++ \"", ++ \"NEEDCOMPOUND xx", ++ \"COMPOUNDPERMITFLAG pp", ++ \"", ++ \"SFX 13 Y 1", ++ \"SFX 13 0 bork .", ++ \"", ++ \"SFX a1 Y 1", ++ \"SFX a1 0 a1 .", ++ \"", ++ \"SFX a\xE9 Y 1", ++ \"SFX a\xE9 0 a\xE9 .", ++ \"", ++ \"PFX zz Y 1", ++ \"PFX zz 0 pre/pp .", ++ \"", ++ \"PFX yy Y 1", ++ \"PFX yy 0 nou .", ++ \ ] ++let g:test_data_dic5 = [ ++ \"1234", ++ \"foo/a1a\xE9!!", ++ \"bar/zz13ee", ++ \"start/ss", ++ \"end/eeyy", ++ \"middle/mmxx", ++ \ ] ++let g:test_data_aff6 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"FLAG caplong", ++ \"", ++ \"NEEDAFFIX A!", ++ \"", ++ \"COMPOUNDRULE sMm*Ee", ++ \"", ++ \"NEEDCOMPOUND Xx", ++ \"", ++ \"COMPOUNDPERMITFLAG p", ++ \"", ++ \"SFX N3 Y 1", ++ \"SFX N3 0 bork .", ++ \"", ++ \"SFX A1 Y 1", ++ \"SFX A1 0 a1 .", ++ \"", ++ \"SFX A\xE9 Y 1", ++ \"SFX A\xE9 0 a\xE9 .", ++ \"", ++ \"PFX Zz Y 1", ++ \"PFX Zz 0 pre/p .", ++ \ ] ++let g:test_data_dic6 = [ ++ \"1234", ++ \"mee/A1A\xE9A!", ++ \"bar/ZzN3Ee", ++ \"lead/s", ++ \"end/Ee", ++ \"middle/MmXx", ++ \ ] ++let g:test_data_aff7 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"FLAG num", ++ \"", ++ \"NEEDAFFIX 9999", ++ \"", ++ \"COMPOUNDRULE 2,77*123", ++ \"", ++ \"NEEDCOMPOUND 1", ++ \"COMPOUNDPERMITFLAG 432", ++ \"", ++ \"SFX 61003 Y 1", ++ \"SFX 61003 0 meat .", ++ \"", ++ \"SFX 0 Y 1", ++ \"SFX 0 0 zero .", ++ \"", ++ \"SFX 391 Y 1", ++ \"SFX 391 0 a1 .", ++ \"", ++ \"SFX 111 Y 1", ++ \"SFX 111 0 a\xE9 .", ++ \"", ++ \"PFX 17 Y 1", ++ \"PFX 17 0 pre/432 .", ++ \ ] ++let g:test_data_dic7 = [ ++ \"1234", ++ \"mee/0,391,111,9999", ++ \"bar/17,61003,123", ++ \"lead/2", ++ \"tail/123", ++ \"middle/77,1", ++ \ ] ++let g:test_data_aff8 = [ ++ \"SET ISO8859-1", ++ \"", ++ \"NOSPLITSUGS", ++ \ ] ++let g:test_data_dic8 = [ ++ \"1234", ++ \"foo", ++ \"bar", ++ \"faabar", ++ \ ] ++let g:test_data_aff9 = [ ++ \ ] ++let g:test_data_dic9 = [ ++ \"1234", ++ \"foo", ++ \"bar", ++ \ ] ++let g:test_data_aff10 = [ ++ \"COMPOUNDRULE se", ++ \"COMPOUNDPERMITFLAG p", ++ \"", ++ \"SFX A Y 1", ++ \"SFX A 0 able/Mp .", ++ \"", ++ \"SFX M Y 1", ++ \"SFX M 0 s .", ++ \ ] ++let g:test_data_dic10 = [ ++ \"1234", ++ \"drink/As", ++ \"table/e", ++ \ ] ++let g:test_data_aff_sal = [ ++ \"SET ISO8859-1", ++ \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", ++ \"", ++ \"FOL \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"LOW \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF", ++ \"UPP \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF", ++ \"", ++ \"MIDWORD\t'-", ++ \"", ++ \"KEP =", ++ \"RAR ?", ++ \"BAD !", ++ \"", ++ \"PFX I N 1", ++ \"PFX I 0 in .", ++ \"", ++ \"PFX O Y 1", ++ \"PFX O 0 out .", ++ \"", ++ \"SFX S Y 2", ++ \"SFX S 0 s [^s]", ++ \"SFX S 0 es s", ++ \"", ++ \"SFX N N 3", ++ \"SFX N 0 en [^n]", ++ \"SFX N 0 nen n", ++ \"SFX N 0 n .", ++ \"", ++ \"REP 3", ++ \"REP g ch", ++ \"REP ch g", ++ \"REP svp s.v.p.", ++ \"", ++ \"MAP 9", ++ \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5", ++ \"MAP e\xE8\xE9\xEA\xEB", ++ \"MAP i\xEC\xED\xEE\xEF", ++ \"MAP o\xF2\xF3\xF4\xF5\xF6", ++ \"MAP u\xF9\xFA\xFB\xFC", ++ \"MAP n\xF1", ++ \"MAP c\xE7", ++ \"MAP y\xFF\xFD", ++ \"MAP s\xDF", ++ \"", ++ \"SAL AH(AEIOUY)-^ *H", ++ \"SAL AR(AEIOUY)-^ *R", ++ \"SAL A(HR)^ *", ++ \"SAL A^ *", ++ \"SAL AH(AEIOUY)- H", ++ \"SAL AR(AEIOUY)- R", ++ \"SAL A(HR) _", ++ \"SAL \xC0^ *", ++ \"SAL \xC5^ *", ++ \"SAL BB- _", ++ \"SAL B B", ++ \"SAL CQ- _", ++ \"SAL CIA X", ++ \"SAL CH X", ++ \"SAL C(EIY)- S", ++ \"SAL CK K", ++ \"SAL COUGH^ KF", ++ \"SAL CC< C", ++ \"SAL C K", ++ \"SAL DG(EIY) K", ++ \"SAL DD- _", ++ \"SAL D T", ++ \"SAL \xC9< E", ++ \"SAL EH(AEIOUY)-^ *H", ++ \"SAL ER(AEIOUY)-^ *R", ++ \"SAL E(HR)^ *", ++ \"SAL ENOUGH^$ *NF", ++ \"SAL E^ *", ++ \"SAL EH(AEIOUY)- H", ++ \"SAL ER(AEIOUY)- R", ++ \"SAL E(HR) _", ++ \"SAL FF- _", ++ \"SAL F F", ++ \"SAL GN^ N", ++ \"SAL GN$ N", ++ \"SAL GNS$ NS", ++ \"SAL GNED$ N", ++ \"SAL GH(AEIOUY)- K", ++ \"SAL GH _", ++ \"SAL GG9 K", ++ \"SAL G K", ++ \"SAL H H", ++ \"SAL IH(AEIOUY)-^ *H", ++ \"SAL IR(AEIOUY)-^ *R", ++ \"SAL I(HR)^ *", ++ \"SAL I^ *", ++ \"SAL ING6 N", ++ \"SAL IH(AEIOUY)- H", ++ \"SAL IR(AEIOUY)- R", ++ \"SAL I(HR) _", ++ \"SAL J K", ++ \"SAL KN^ N", ++ \"SAL KK- _", ++ \"SAL K K", ++ \"SAL LAUGH^ LF", ++ \"SAL LL- _", ++ \"SAL L L", ++ \"SAL MB$ M", ++ \"SAL MM M", ++ \"SAL M M", ++ \"SAL NN- _", ++ \"SAL N N", ++ \"SAL OH(AEIOUY)-^ *H", ++ \"SAL OR(AEIOUY)-^ *R", ++ \"SAL O(HR)^ *", ++ \"SAL O^ *", ++ \"SAL OH(AEIOUY)- H", ++ \"SAL OR(AEIOUY)- R", ++ \"SAL O(HR) _", ++ \"SAL PH F", ++ \"SAL PN^ N", ++ \"SAL PP- _", ++ \"SAL P P", ++ \"SAL Q K", ++ \"SAL RH^ R", ++ \"SAL ROUGH^ RF", ++ \"SAL RR- _", ++ \"SAL R R", ++ \"SAL SCH(EOU)- SK", ++ \"SAL SC(IEY)- S", ++ \"SAL SH X", ++ \"SAL SI(AO)- X", ++ \"SAL SS- _", ++ \"SAL S S", ++ \"SAL TI(AO)- X", ++ \"SAL TH @", ++ \"SAL TCH-- _", ++ \"SAL TOUGH^ TF", ++ \"SAL TT- _", ++ \"SAL T T", ++ \"SAL UH(AEIOUY)-^ *H", ++ \"SAL UR(AEIOUY)-^ *R", ++ \"SAL U(HR)^ *", ++ \"SAL U^ *", ++ \"SAL UH(AEIOUY)- H", ++ \"SAL UR(AEIOUY)- R", ++ \"SAL U(HR) _", ++ \"SAL V^ W", ++ \"SAL V F", ++ \"SAL WR^ R", ++ \"SAL WH^ W", ++ \"SAL W(AEIOU)- W", ++ \"SAL X^ S", ++ \"SAL X KS", ++ \"SAL Y(AEIOU)- Y", ++ \"SAL ZZ- _", ++ \"SAL Z S", ++ \ ] ++ ++func LoadAffAndDic(aff_contents, dic_contents) ++ set enc=utf-8 ++ set spellfile= ++ call writefile(a:aff_contents, "Xtest.aff") ++ call writefile(a:dic_contents, "Xtest.dic") ++ " Generate a .spl file from a .dic and .aff file. ++ mkspell! Xtest Xtest ++ " use that spell file ++ set spl=Xtest.utf-8.spl spell ++endfunc ++ ++func ListWords() ++ spelldump ++ %yank ++ quit ++ return split(@", "\n") ++endfunc ++ ++func TestGoodBadBase() ++ exe '1;/^good:' ++ normal 0f:]s ++ let prevbad = '' ++ let result = [] ++ while 1 ++ let [bad, a] = spellbadword() ++ if bad == '' || bad == prevbad || bad == 'badend' ++ break ++ endif ++ let prevbad = bad ++ let lst = bad->spellsuggest(3) ++ normal mm ++ ++ call add(result, [bad, lst]) ++ normal `m]s ++ endwhile ++ return result ++endfunc ++ ++func RunGoodBad(good, bad, expected_words, expected_bad_words) ++ %bwipe! ++ call setline(1, ['', "good: ", a:good, a:bad, " badend "]) ++ let words = ListWords() ++ call assert_equal(a:expected_words, words[1:-1]) ++ let bad_words = TestGoodBadBase() ++ call assert_equal(a:expected_bad_words, bad_words) ++ %bwipe! ++endfunc ++ ++func Test_spell_basic() ++ call LoadAffAndDic(g:test_data_aff1, g:test_data_dic1) ++ call RunGoodBad("wrong OK puts. Test the end", ++ \ "bad: inputs comment ok Ok. test d\u00E9\u00F4l end the", ++ \["Comment", "deol", "d\u00E9\u00F4r", "input", "OK", "output", "outputs", "outtest", "put", "puts", ++ \ "test", "testen", "testn", "the end", "uk", "wrong"], ++ \[ ++ \ ["bad", ["put", "uk", "OK"]], ++ \ ["inputs", ["input", "puts", "outputs"]], ++ \ ["comment", ["Comment", "outtest", "the end"]], ++ \ ["ok", ["OK", "uk", "put"]], ++ \ ["Ok", ["OK", "Uk", "Put"]], ++ \ ["test", ["Test", "testn", "testen"]], ++ \ ["d\u00E9\u00F4l", ["deol", "d\u00E9\u00F4r", "test"]], ++ \ ["end", ["put", "uk", "test"]], ++ \ ["the", ["put", "uk", "test"]], ++ \ ] ++ \ ) ++ ++ call assert_equal("gebletegek", soundfold('goobledygoook')) ++ call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold()) ++ call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale')) ++endfunc ++ ++" Postponed prefixes ++func Test_spell_prefixes() ++ call LoadAffAndDic(g:test_data_aff2, g:test_data_dic1) ++ call RunGoodBad("puts", ++ \ "bad: inputs comment ok Ok end the. test d\u00E9\u00F4l", ++ \ ["Comment", "deol", "d\u00E9\u00F4r", "OK", "put", "input", "output", "puts", "outputs", "test", "outtest", "testen", "testn", "the end", "uk", "wrong"], ++ \ [ ++ \ ["bad", ["put", "uk", "OK"]], ++ \ ["inputs", ["input", "puts", "outputs"]], ++ \ ["comment", ["Comment"]], ++ \ ["ok", ["OK", "uk", "put"]], ++ \ ["Ok", ["OK", "Uk", "Put"]], ++ \ ["end", ["put", "uk", "deol"]], ++ \ ["the", ["put", "uk", "test"]], ++ \ ["test", ["Test", "testn", "testen"]], ++ \ ["d\u00E9\u00F4l", ["deol", "d\u00E9\u00F4r", "test"]], ++ \ ]) ++endfunc ++ ++"Compound words ++func Test_spell_compound() ++ call LoadAffAndDic(g:test_data_aff3, g:test_data_dic3) ++ call RunGoodBad("foo m\u00EF foobar foofoobar barfoo barbarfoo", ++ \ "bad: bar la foom\u00EF barm\u00EF m\u00EFfoo m\u00EFbar m\u00EFm\u00EF lala m\u00EFla lam\u00EF foola labar", ++ \ ["foo", "m\u00EF"], ++ \ [ ++ \ ["bad", ["foo", "m\u00EF"]], ++ \ ["bar", ["barfoo", "foobar", "foo"]], ++ \ ["la", ["m\u00EF", "foo"]], ++ \ ["foom\u00EF", ["foo m\u00EF", "foo", "foofoo"]], ++ \ ["barm\u00EF", ["barfoo", "m\u00EF", "barbar"]], ++ \ ["m\u00EFfoo", ["m\u00EF foo", "foo", "foofoo"]], ++ \ ["m\u00EFbar", ["foobar", "barbar", "m\u00EF"]], ++ \ ["m\u00EFm\u00EF", ["m\u00EF m\u00EF", "m\u00EF"]], ++ \ ["lala", []], ++ \ ["m\u00EFla", ["m\u00EF", "m\u00EF m\u00EF"]], ++ \ ["lam\u00EF", ["m\u00EF", "m\u00EF m\u00EF"]], ++ \ ["foola", ["foo", "foobar", "foofoo"]], ++ \ ["labar", ["barbar", "foobar"]], ++ \ ]) ++ ++ call LoadAffAndDic(g:test_data_aff4, g:test_data_dic4) ++ call RunGoodBad("word util bork prebork start end wordutil wordutils pro-ok bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork tomato tomatotomato startend startword startwordword startwordend startwordwordend startwordwordwordend prebork preborkbork preborkborkbork nouword", ++ \ "bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato endstart endend startstart wordend wordstart preborkprebork preborkpreborkbork startwordwordwordwordend borkpreborkpreborkbork utilsbork startnouword", ++ \ ["bork", "prebork", "end", "pro-ok", "start", "tomato", "util", "utilize", "utils", "word", "nouword"], ++ \ [ ++ \ ["bad", ["end", "bork", "word"]], ++ \ ["wordutilize", ["word utilize", "wordutils", "wordutil"]], ++ \ ["pro", ["bork", "word", "end"]], ++ \ ["borkborkborkborkborkbork", ["bork borkborkborkborkbork", "borkbork borkborkborkbork", "borkborkbork borkborkbork"]], ++ \ ["tomatotomatotomato", ["tomato tomatotomato", "tomatotomato tomato", "tomato tomato tomato"]], ++ \ ["endstart", ["end start", "start"]], ++ \ ["endend", ["end end", "end"]], ++ \ ["startstart", ["start start"]], ++ \ ["wordend", ["word end", "word", "wordword"]], ++ \ ["wordstart", ["word start", "bork start"]], ++ \ ["preborkprebork", ["prebork prebork", "preborkbork", "preborkborkbork"]], ++ \ ["preborkpreborkbork", ["prebork preborkbork", "preborkborkbork", "preborkborkborkbork"]], ++ \ ["startwordwordwordwordend", ["startwordwordwordword end", "startwordwordwordword", "start wordwordwordword end"]], ++ \ ["borkpreborkpreborkbork", ["bork preborkpreborkbork", "bork prebork preborkbork", "bork preborkprebork bork"]], ++ \ ["utilsbork", ["utilbork", "utils bork", "util bork"]], ++ \ ["startnouword", ["start nouword", "startword", "startborkword"]], ++ \ ]) ++ ++endfunc ++ ++" Test affix flags with two characters ++func Test_spell_affix() ++ call LoadAffAndDic(g:test_data_aff5, g:test_data_dic5) ++ call RunGoodBad("fooa1 fooa\u00E9 bar prebar barbork prebarbork startprebar start end startend startmiddleend nouend", ++ \ "bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend", ++ \ ["bar", "barbork", "end", "fooa1", "fooa\u00E9", "nouend", "prebar", "prebarbork", "start"], ++ \ [ ++ \ ["bad", ["bar", "end", "fooa1"]], ++ \ ["foo", ["fooa1", "fooa\u00E9", "bar"]], ++ \ ["fooa2", ["fooa1", "fooa\u00E9", "bar"]], ++ \ ["prabar", ["prebar", "bar", "bar bar"]], ++ \ ["probarbirk", ["prebarbork"]], ++ \ ["middle", []], ++ \ ["startmiddle", ["startmiddleend", "startmiddlebar"]], ++ \ ["middleend", []], ++ \ ["endstart", ["end start", "start"]], ++ \ ["startprobar", ["startprebar", "start prebar", "startbar"]], ++ \ ["startnouend", ["start nouend", "startend"]], ++ \ ]) ++ ++ call LoadAffAndDic(g:test_data_aff6, g:test_data_dic6) ++ call RunGoodBad("meea1 meea\u00E9 bar prebar barbork prebarbork leadprebar lead end leadend leadmiddleend", ++ \ "bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar", ++ \ ["bar", "barbork", "end", "lead", "meea1", "meea\u00E9", "prebar", "prebarbork"], ++ \ [ ++ \ ["bad", ["bar", "end", "lead"]], ++ \ ["mee", ["meea1", "meea\u00E9", "bar"]], ++ \ ["meea2", ["meea1", "meea\u00E9", "lead"]], ++ \ ["prabar", ["prebar", "bar", "leadbar"]], ++ \ ["probarbirk", ["prebarbork"]], ++ \ ["middle", []], ++ \ ["leadmiddle", ["leadmiddleend", "leadmiddlebar"]], ++ \ ["middleend", []], ++ \ ["endlead", ["end lead", "lead", "end end"]], ++ \ ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]], ++ \ ]) ++ ++ call LoadAffAndDic(g:test_data_aff7, g:test_data_dic7) ++ call RunGoodBad("meea1 meezero meea\u00E9 bar prebar barmeat prebarmeat leadprebar lead tail leadtail leadmiddletail", ++ \ "bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead leadprobar", ++ \ ["bar", "barmeat", "lead", "meea1", "meea\u00E9", "meezero", "prebar", "prebarmeat", "tail"], ++ \ [ ++ \ ["bad", ["bar", "lead", "tail"]], ++ \ ["mee", ["meea1", "meea\u00E9", "bar"]], ++ \ ["meea2", ["meea1", "meea\u00E9", "lead"]], ++ \ ["prabar", ["prebar", "bar", "leadbar"]], ++ \ ["probarmaat", ["prebarmeat"]], ++ \ ["middle", []], ++ \ ["leadmiddle", ["leadmiddlebar"]], ++ \ ["middletail", []], ++ \ ["taillead", ["tail lead", "tail"]], ++ \ ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]], ++ \ ]) ++endfunc ++ ++func Test_spell_NOSLITSUGS() ++ call LoadAffAndDic(g:test_data_aff8, g:test_data_dic8) ++ call RunGoodBad("foo bar faabar", "bad: foobar barfoo", ++ \ ["bar", "faabar", "foo"], ++ \ [ ++ \ ["bad", ["bar", "foo"]], ++ \ ["foobar", ["faabar", "foo bar", "bar"]], ++ \ ["barfoo", ["bar foo", "bar", "foo"]], ++ \ ]) ++endfunc ++ ++" Numbers ++func Test_spell_Numbers() ++ call LoadAffAndDic(g:test_data_aff9, g:test_data_dic9) ++ call RunGoodBad("0b1011 0777 1234 0x01ff", "", ++ \ ["bar", "foo"], ++ \ [ ++ \ ]) ++endfunc ++ ++" Affix flags ++func Test_spell_affix_flags() ++ call LoadAffAndDic(g:test_data_aff10, g:test_data_dic10) ++ call RunGoodBad("drink drinkable drinkables drinktable drinkabletable", ++ \ "bad: drinks drinkstable drinkablestable", ++ \ ["drink", "drinkable", "drinkables", "table"], ++ \ [['bad', []], ++ \ ['drinks', ['drink']], ++ \ ['drinkstable', ['drinktable', 'drinkable', 'drink table']], ++ \ ['drinkablestable', ['drinkabletable', 'drinkables table', 'drinkable table']], ++ \ ]) ++endfunc ++ ++function FirstSpellWord() ++ call feedkeys("/^start:\n", 'tx') ++ normal ]smm ++ let [str, a] = spellbadword() ++ return str ++endfunc ++ ++function SecondSpellWord() ++ normal `m]s ++ let [str, a] = spellbadword() ++ return str ++endfunc ++ ++" Test with SAL instead of SOFO items; test automatic reloading ++func Test_spell_sal_and_addition() ++ set spellfile= ++ call writefile(g:test_data_dic1, "Xtest.dic") ++ call writefile(g:test_data_aff_sal, "Xtest.aff") ++ mkspell! Xtest Xtest ++ set spl=Xtest.utf-8.spl spell ++ call assert_equal('kbltykk', soundfold('goobledygoook')) ++ call assert_equal('kprnfn', soundfold('kóopërÿnôven')) ++ call assert_equal('*fls kswts tl', soundfold('oeverloos gezwets edale')) ++ ++ "also use an addition file ++ call writefile(["/regions=usgbnz", "elequint/2", "elekwint/3"], "Xtest.utf-8.add") ++ mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add ++ ++ bwipe! ++ call setline(1, ["start: elequint test elekwint test elekwent asdf"]) ++ ++ set spellfile=Xtest.utf-8.add ++ call assert_equal("elekwent", FirstSpellWord()) ++ ++ set spl=Xtest_us.utf-8.spl ++ call assert_equal("elequint", FirstSpellWord()) ++ call assert_equal("elekwint", SecondSpellWord()) ++ ++ set spl=Xtest_gb.utf-8.spl ++ call assert_equal("elekwint", FirstSpellWord()) ++ call assert_equal("elekwent", SecondSpellWord()) ++ ++ set spl=Xtest_nz.utf-8.spl ++ call assert_equal("elequint", FirstSpellWord()) ++ call assert_equal("elekwent", SecondSpellWord()) ++ ++ set spl=Xtest_ca.utf-8.spl ++ call assert_equal("elequint", FirstSpellWord()) ++ call assert_equal("elekwint", SecondSpellWord()) ++endfunc ++ ++func Test_spellfile_value() ++ set spellfile=Xdir/Xtest.utf-8.add ++ set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add ++endfunc ++ ++" vim: shiftwidth=2 sts=2 expandtab +-- +1.8.3.1 + diff --git a/backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch b/backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch new file mode 100644 index 0000000..ee5073c --- /dev/null +++ b/backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch @@ -0,0 +1,72 @@ +From e275ba4fc994474155fbafe8b87a6d3b477456ba Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 6 Oct 2021 13:41:07 +0100 +Subject: [PATCH] patch 8.2.3484: crash when going through spell suggestions + +Problem: Crash when going through spell suggestions. +Solution: Limit the text length for finding suggestions to the original +length. Do not update buffers when exiting. (closes #8965) +--- + src/spellsuggest.c | 5 +++++ + src/testdir/test_spell_utf8.vim | 16 ++++++++++++++++ + src/ui.c | 3 ++- + 3 files changed, 23 insertions(+), 1 deletion(-) + +diff --git a/src/spellsuggest.c b/src/spellsuggest.c +index 0171a5b..0f833f5 100644 +--- a/src/spellsuggest.c ++++ b/src/spellsuggest.c +@@ -1169,6 +1169,11 @@ suggest_try_change(suginfo_T *su) + p = su->su_badptr + su->su_badlen; + (void)spell_casefold(p, (int)STRLEN(p), fword + n, MAXWLEN - n); + ++ // Make sure the resulting text is not longer than the original text. ++ n = (int)STRLEN(su->su_badptr); ++ if (n < MAXWLEN) ++ fword[n] = NUL; ++ + for (lpi = 0; lpi < curwin->w_s->b_langp.ga_len; ++lpi) + { + lp = LANGP_ENTRY(curwin->w_s->b_langp, lpi); +diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim +index 1f561e4..79dc3e4 100644 +--- a/src/testdir/test_spell_utf8.vim ++++ b/src/testdir/test_spell_utf8.vim +@@ -765,4 +765,20 @@ func Test_spellfile_value() + set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add + endfunc + ++func Test_no_crash_with_weird_text() ++ new ++ let lines =<< trim END ++ r ++ € ++ ++ ++ € ++ END ++ call setline(1, lines) ++ exe "%norm \ez=>\wzG" ++ ++ bwipe! ++endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab +diff --git a/src/ui.c b/src/ui.c +index 7ec1e56..8d6f681 100644 +--- a/src/ui.c ++++ b/src/ui.c +@@ -868,7 +868,8 @@ clip_lose_selection(Clipboard_T *cbd) + || get_real_state() == SELECTMODE) + && (cbd == &clip_star ? + clip_isautosel_star() : clip_isautosel_plus()) +- && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) ++ && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) ++ && !exiting) + { + update_curbuf(INVERTED_ALL); + setcursor(); +-- +1.8.3.1 + diff --git a/backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch b/backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch new file mode 100644 index 0000000..0340243 --- /dev/null +++ b/backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch @@ -0,0 +1,95 @@ +From 6d24b4ff69913270ce1e5267dd6bd8454f75e2b9 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Mon, 23 May 2022 12:01:50 +0100 +Subject: [PATCH] patch 8.2.5007: spell suggestion may use uninitialized memory + +Problem: Spell suggestion may use uninitialized memory. (Zdenek Dohnal) +Solution: Avoid going over the end of the word. +--- + src/spellsuggest.c | 3 ++- + src/testdir/test_spell_utf8.vim | 23 ++++++++++++++++++++--- + 2 files changed, 22 insertions(+), 4 deletions(-) + +diff --git a/src/spellsuggest.c b/src/spellsuggest.c +index 0f833f5..2b7d13b 100644 +--- a/src/spellsuggest.c ++++ b/src/spellsuggest.c +@@ -1924,7 +1924,8 @@ suggest_trie_walk( + #endif + ++depth; + sp = &stack[depth]; +- ++sp->ts_fidx; ++ if (fword[sp->ts_fidx] != NUL) ++ ++sp->ts_fidx; + tword[sp->ts_twordlen++] = c; + sp->ts_arridx = idxs[arridx]; + if (newscore == SCORE_SUBST) +diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim +index 79dc3e4..491a406 100644 +--- a/src/testdir/test_spell_utf8.vim ++++ b/src/testdir/test_spell_utf8.vim +@@ -629,7 +629,7 @@ func Test_spell_affix() + \ ["bar", "barbork", "end", "fooa1", "fooa\u00E9", "nouend", "prebar", "prebarbork", "start"], + \ [ + \ ["bad", ["bar", "end", "fooa1"]], +- \ ["foo", ["fooa1", "fooa\u00E9", "bar"]], ++ \ ["foo", ["fooa1", "bar", "end"]], + \ ["fooa2", ["fooa1", "fooa\u00E9", "bar"]], + \ ["prabar", ["prebar", "bar", "bar bar"]], + \ ["probarbirk", ["prebarbork"]], +@@ -647,7 +647,7 @@ func Test_spell_affix() + \ ["bar", "barbork", "end", "lead", "meea1", "meea\u00E9", "prebar", "prebarbork"], + \ [ + \ ["bad", ["bar", "end", "lead"]], +- \ ["mee", ["meea1", "meea\u00E9", "bar"]], ++ \ ["mee", ["meea1", "bar", "end"]], + \ ["meea2", ["meea1", "meea\u00E9", "lead"]], + \ ["prabar", ["prebar", "bar", "leadbar"]], + \ ["probarbirk", ["prebarbork"]], +@@ -664,7 +664,7 @@ func Test_spell_affix() + \ ["bar", "barmeat", "lead", "meea1", "meea\u00E9", "meezero", "prebar", "prebarmeat", "tail"], + \ [ + \ ["bad", ["bar", "lead", "tail"]], +- \ ["mee", ["meea1", "meea\u00E9", "bar"]], ++ \ ["mee", ["meea1", "bar", "lead"]], + \ ["meea2", ["meea1", "meea\u00E9", "lead"]], + \ ["prabar", ["prebar", "bar", "leadbar"]], + \ ["probarmaat", ["prebarmeat"]], +@@ -758,11 +758,15 @@ func Test_spell_sal_and_addition() + set spl=Xtest_ca.utf-8.spl + call assert_equal("elequint", FirstSpellWord()) + call assert_equal("elekwint", SecondSpellWord()) ++ ++ set spellfile= ++ set spl& + endfunc + + func Test_spellfile_value() + set spellfile=Xdir/Xtest.utf-8.add + set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add ++ set spellfile= + endfunc + + func Test_no_crash_with_weird_text() +@@ -780,5 +784,18 @@ func Test_no_crash_with_weird_text() + bwipe! + endfunc + ++" This was going over the end of the word ++func Test_word_index() ++ new ++ norm R0 ++ spellgood! fl0 ++ sil norm z= ++ ++ bwipe! ++ " clear the word list ++ set enc=utf-8 ++ call delete('Xtmpfile') ++endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab +-- +1.8.3.1 + diff --git a/vim.spec b/vim.spec index 9d25a13..51dcd72 100644 --- a/vim.spec +++ b/vim.spec @@ -11,7 +11,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 37 +Release: 38 Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text. License: Vim and MIT URL: http://www.vim.org @@ -113,6 +113,10 @@ Patch6079: backport-CVE-2022-1771.patch Patch6080: backport-CVE-2022-2124.patch Patch6081: backport-CVE-2022-2175.patch Patch6082: backport-patch-8.2.5149-cannot-build-without-the-eval-feature.patch +Patch6083: backport-patch-8.2.1354-test-59-is-old-style.patch +Patch6084: backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch +Patch6085: backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch +Patch6086: backport-CVE-2022-2126.patch Patch9000: bugfix-rm-modify-info-version.patch Patch9001: remove-failed-tests-due-to-patch.patch @@ -515,6 +519,12 @@ LC_ALL=en_US.UTF-8 make -j1 test %{_mandir}/man1/evim.* %changelog +* Wed Jun 29 2022 shixuantong - 2:8.2-38 +- Type:CVE +- ID:CVE-2022-2126 +- SUG:NA +- DESC:fix CVE-2022-2126 + * Tue Jun 28 2022 renhongxun - 2:8.2-37 - Type:CVE - ID:CVE-2022-2175 -- Gitee