diff --git a/backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch b/backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch index 3eab161545171d2b7883f4a00f9cef296c3f59be..a14c3672239be9c2ccc2472e770e5546a500ea39 100644 --- a/backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch +++ b/backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch @@ -11,10 +11,10 @@ Solution: Only check cursor line number. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/move.c b/src/move.c -index 1d7bcfb..3760042 100644 +index 6c654ac..4123ca8 100644 --- a/src/move.c +++ b/src/move.c -@@ -637,7 +637,7 @@ cursor_valid(void) +@@ -652,7 +652,7 @@ cursor_valid(void) void validate_cursor(void) { @@ -24,5 +24,5 @@ index 1d7bcfb..3760042 100644 if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW)) curs_columns(TRUE); -- -2.33.0 +2.27.0 diff --git a/backport-CVE-2021-3770.patch b/backport-CVE-2021-3770.patch deleted file mode 100644 index 781cfa43de4b643073894d677982f6fa398f4526..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3770.patch +++ /dev/null @@ -1,206 +0,0 @@ -From b7081e135a16091c93f6f5f7525a5c58fb7ca9f9 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 4 Sep 2021 18:47:28 +0200 -Subject: [PATCH] patch 8.2.3402: invalid memory access when using :retab with - large value - -Problem: Invalid memory access when using :retab with large value. -Solution: Check the number is positive. ---- - src/indent.c | 34 +++++++++++++++++++++------------- - src/option.c | 12 ++++++------ - src/optionstr.c | 4 ++-- - src/testdir/test_retab.vim | 3 +++ - src/version.c | 2 ++ - 5 files changed, 34 insertions(+), 21 deletions(-) - -diff --git a/src/indent.c b/src/indent.c -index 32f1e12..7e196c2 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -18,18 +18,19 @@ - /* - * Set the integer values corresponding to the string setting of 'vartabstop'. - * "array" will be set, caller must free it if needed. -+ * Return FAIL for an error. - */ - int - tabstop_set(char_u *var, int **array) - { -- int valcount = 1; -- int t; -- char_u *cp; -+ int valcount = 1; -+ int t; -+ char_u *cp; - - if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) - { - *array = NULL; -- return TRUE; -+ return OK; - } - - for (cp = var; *cp != NUL; ++cp) -@@ -43,8 +44,8 @@ tabstop_set(char_u *var, int **array) - if (cp != end) - emsg(_(e_positive)); - else -- emsg(_(e_invarg)); -- return FALSE; -+ semsg(_(e_invarg2), cp); -+ return FAIL; - } - } - -@@ -55,26 +56,33 @@ tabstop_set(char_u *var, int **array) - ++valcount; - continue; - } -- emsg(_(e_invarg)); -- return FALSE; -+ semsg(_(e_invarg2), var); -+ return FAIL; - } - - *array = ALLOC_MULT(int, valcount + 1); - if (*array == NULL) -- return FALSE; -+ return FAIL; - (*array)[0] = valcount; - - t = 1; - for (cp = var; *cp != NUL;) - { -- (*array)[t++] = atoi((char *)cp); -- while (*cp != NUL && *cp != ',') -+ int n = atoi((char *)cp); -+ -+ if (n < 0 || n > 9999) -+ { -+ semsg(_(e_invarg2), cp); -+ return FAIL; -+ } -+ (*array)[t++] = n; -+ while (*cp != NUL && *cp != ',') - ++cp; - if (*cp != NUL) - ++cp; - } - -- return TRUE; -+ return OK; - } - - /* -@@ -1556,7 +1564,7 @@ ex_retab(exarg_T *eap) - - #ifdef FEAT_VARTABS - new_ts_str = eap->arg; -- if (!tabstop_set(eap->arg, &new_vts_array)) -+ if (tabstop_set(eap->arg, &new_vts_array) == FAIL) - return; - while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',') - ++(eap->arg); -diff --git a/src/option.c b/src/option.c -index 5c99c69..e9598d6 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -2292,9 +2292,9 @@ didset_options2(void) - #endif - #ifdef FEAT_VARTABS - vim_free(curbuf->b_p_vsts_array); -- tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array); -+ (void)tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array); - vim_free(curbuf->b_p_vts_array); -- tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array); -+ (void)tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array); - #endif - } - -@@ -5756,7 +5756,7 @@ buf_copy_options(buf_T *buf, int flags) - buf->b_p_vsts = vim_strsave(p_vsts); - COPY_OPT_SCTX(buf, BV_VSTS); - if (p_vsts && p_vsts != empty_option) -- tabstop_set(p_vsts, &buf->b_p_vsts_array); -+ (void)tabstop_set(p_vsts, &buf->b_p_vsts_array); - else - buf->b_p_vsts_array = 0; - buf->b_p_vsts_nopaste = p_vsts_nopaste -@@ -5914,7 +5914,7 @@ buf_copy_options(buf_T *buf, int flags) - buf->b_p_isk = save_p_isk; - #ifdef FEAT_VARTABS - if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) -- tabstop_set(p_vts, &buf->b_p_vts_array); -+ (void)tabstop_set(p_vts, &buf->b_p_vts_array); - else - buf->b_p_vts_array = NULL; - #endif -@@ -5929,7 +5929,7 @@ buf_copy_options(buf_T *buf, int flags) - buf->b_p_vts = vim_strsave(p_vts); - COPY_OPT_SCTX(buf, BV_VTS); - if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) -- tabstop_set(p_vts, &buf->b_p_vts_array); -+ (void)tabstop_set(p_vts, &buf->b_p_vts_array); - else - buf->b_p_vts_array = NULL; - #endif -@@ -6634,7 +6634,7 @@ paste_option_changed(void) - if (buf->b_p_vsts_array) - vim_free(buf->b_p_vsts_array); - if (buf->b_p_vsts && buf->b_p_vsts != empty_option) -- tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); -+ (void)tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); - else - buf->b_p_vsts_array = 0; - #endif -diff --git a/src/optionstr.c b/src/optionstr.c -index 98e90a4..383babe 100644 ---- a/src/optionstr.c -+++ b/src/optionstr.c -@@ -2166,7 +2166,7 @@ did_set_string_option( - if (errmsg == NULL) - { - int *oldarray = curbuf->b_p_vsts_array; -- if (tabstop_set(*varp, &(curbuf->b_p_vsts_array))) -+ if (tabstop_set(*varp, &(curbuf->b_p_vsts_array)) == OK) - { - if (oldarray) - vim_free(oldarray); -@@ -2205,7 +2205,7 @@ did_set_string_option( - { - int *oldarray = curbuf->b_p_vts_array; - -- if (tabstop_set(*varp, &(curbuf->b_p_vts_array))) -+ if (tabstop_set(*varp, &(curbuf->b_p_vts_array)) == OK) - { - vim_free(oldarray); - #ifdef FEAT_FOLDING -diff --git a/src/testdir/test_retab.vim b/src/testdir/test_retab.vim -index f11a32b..e7b8946 100644 ---- a/src/testdir/test_retab.vim -+++ b/src/testdir/test_retab.vim -@@ -74,4 +74,7 @@ endfunc - func Test_retab_error() - call assert_fails('retab -1', 'E487:') - call assert_fails('retab! -1', 'E487:') -+ call assert_fails('ret -1000', 'E487:') -+ call assert_fails('ret 10000', 'E475:') -+ call assert_fails('ret 80000000000000000000', 'E475:') - endfunc -diff --git a/src/version.c b/src/version.c -index 3ef6259..8912f62 100644 ---- a/src/version.c -+++ b/src/version.c -@@ -743,6 +743,8 @@ static char *(features[]) = - static int included_patches[] = - { /* Add new patch number below this line */ - /**/ -+ 3402, -+/**/ - 0 - }; - --- -1.8.3.1 - diff --git a/backport-CVE-2021-3778.patch b/backport-CVE-2021-3778.patch deleted file mode 100644 index e1ef68a88bbc39d34027d3411911d5b8c67d5013..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3778.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 65b605665997fad54ef39a93199e305af2fe4d7f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 7 Sep 2021 19:26:53 +0200 -Subject: [PATCH] patch 8.2.3409: reading beyond end of line with invalid utf-8 - character - -Problem: Reading beyond end of line with invalid utf-8 character. -Solution: Check for NUL when advancing. ---- - src/regexp_nfa.c | 3 ++- - src/testdir/test_regexp_utf8.vim | 8 ++++++++ - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c -index fb512f9..bc4a4b6 100644 ---- a/src/regexp_nfa.c -+++ b/src/regexp_nfa.c -@@ -5455,7 +5455,8 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text) - match = FALSE; - break; - } -- len2 += MB_CHAR2LEN(c2); -+ len2 += enc_utf8 ? utf_ptr2len(rex.line + col + len2) -+ : MB_CHAR2LEN(c2); - } - if (match - // check that no composing char follows -diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim -index 19ff882..6d0ce59 100644 ---- a/src/testdir/test_regexp_utf8.vim -+++ b/src/testdir/test_regexp_utf8.vim -@@ -215,3 +215,11 @@ func Test_optmatch_toolong() - set re=0 - endfunc - -+func Test_match_invalid_byte() -+ call writefile(0z630a.765d30aa0a.2e0a.790a.4030, 'Xinvalid') -+ new -+ source Xinvalid -+ bwipe! -+ call delete('Xinvalid') -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2021-3796.patch b/backport-CVE-2021-3796.patch deleted file mode 100644 index 654b4e58ef019415ec781f2e1ab01ecf394fc74e..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3796.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 35a9a00afcb20897d462a766793ff45534810dc3 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 11 Sep 2021 21:14:20 +0200 -Subject: [PATCH] patch 8.2.3428: using freed memory when replacing - -Problem: Using freed memory when replacing. (Dhiraj Mishra) -Solution: Get the line pointer after calling ins_copychar(). ---- - src/normal.c | 10 +++++++--- - src/testdir/test_edit.vim | 13 +++++++++++++ - 2 files changed, 20 insertions(+), 3 deletions(-) - -diff --git a/src/normal.c b/src/normal.c -index c4963e6..d6333b9 100644 ---- a/src/normal.c -+++ b/src/normal.c -@@ -5009,19 +5009,23 @@ nv_replace(cmdarg_T *cap) - { - /* - * Get ptr again, because u_save and/or showmatch() will have -- * released the line. At the same time we let know that the -- * line will be changed. -+ * released the line. This may also happen in ins_copychar(). -+ * At the same time we let know that the line will be changed. - */ -- ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); - if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y) - { - int c = ins_copychar(curwin->w_cursor.lnum - + (cap->nchar == Ctrl_Y ? -1 : 1)); -+ -+ ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); - if (c != NUL) - ptr[curwin->w_cursor.col] = c; - } - else -+ { -+ ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); - ptr[curwin->w_cursor.col] = cap->nchar; -+ } - if (p_sm && msg_silent == 0) - showmatch(cap->nchar); - ++curwin->w_cursor.col; -diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim -index 4e29e7f..c3b1af5 100644 ---- a/src/testdir/test_edit.vim -+++ b/src/testdir/test_edit.vim -@@ -1519,3 +1519,16 @@ func Test_edit_noesckeys() - bwipe! - set esckeys - endfunc -+ -+" Test for getting the character of the line below after "p" -+func Test_edit_put_CTRL_E() -+ set encoding=latin1 -+ new -+ let @" = '' -+ sil! norm orggRx -+ sil! norm pr -+ call assert_equal(['r', 'r'], getline(1, 2)) -+ bwipe! -+ set encoding=utf-8 -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2021-3872.patch b/backport-CVE-2021-3872.patch deleted file mode 100644 index 32769f0b5b66357fa9f75c1c664b44caf2c19d85..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3872.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 826bfe4bbd7594188e3d74d2539d9707b1c6a14b Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 8 Oct 2021 18:39:28 +0100 -Subject: [PATCH] patch 8.2.3487: illegal memory access if buffer name is very - long - -Problem: Illegal memory access if buffer name is very long. -Solution: Make sure not to go over the end of the buffer. ---- - src/drawscreen.c | 10 +++++----- - src/testdir/test_statusline.vim | 10 ++++++++++ - 2 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/src/drawscreen.c b/src/drawscreen.c -index 3a88ee9..9acb705 100644 ---- a/src/drawscreen.c -+++ b/src/drawscreen.c -@@ -446,13 +446,13 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) - *(p + len++) = ' '; - if (bt_help(wp->w_buffer)) - { -- STRCPY(p + len, _("[Help]")); -+ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]")); - len += (int)STRLEN(p + len); - } - #ifdef FEAT_QUICKFIX - if (wp->w_p_pvw) - { -- STRCPY(p + len, _("[Preview]")); -+ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]")); - len += (int)STRLEN(p + len); - } - #endif -@@ -462,12 +462,12 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) - #endif - ) - { -- STRCPY(p + len, "[+]"); -- len += 3; -+ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]"); -+ len += (int)STRLEN(p + len); - } - if (wp->w_buffer->b_p_ro) - { -- STRCPY(p + len, _("[RO]")); -+ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]")); - len += (int)STRLEN(p + len); - } - -diff --git a/src/testdir/test_statusline.vim b/src/testdir/test_statusline.vim -index 1f705b8..febb5d6 100644 ---- a/src/testdir/test_statusline.vim -+++ b/src/testdir/test_statusline.vim -@@ -393,3 +393,13 @@ func Test_statusline_visual() - bwipe! x1 - bwipe! x2 - endfunc -+ -+" Used to write beyond allocated memory. This assumes MAXPATHL is 4096 bytes. -+func Test_statusline_verylong_filename() -+ let fname = repeat('x', 4090) -+ exe "new " .. fname -+ set buftype=help -+ set previewwindow -+ redraw -+ bwipe! -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2021-3875.patch b/backport-CVE-2021-3875.patch deleted file mode 100644 index db3cf9a0297bfd082b84e7a21a833bb0053ef443..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3875.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 35a319b77f897744eec1155b736e9372c9c5575f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 9 Oct 2021 13:58:55 +0100 -Subject: [PATCH] patch 8.2.3489: ml_get error after search with range - -Problem: ml_get error after search with range. -Solution: Limit the line number to the buffer line count. ---- - src/ex_docmd.c | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index 76daf43..12554fa 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -3586,8 +3586,10 @@ get_address( - - // When '/' or '?' follows another address, start from - // there. -- if (lnum != MAXLNUM) -- curwin->w_cursor.lnum = lnum; -+ if (lnum > 0 && lnum != MAXLNUM) -+ curwin->w_cursor.lnum = -+ lnum > curbuf->b_ml.ml_line_count -+ ? curbuf->b_ml.ml_line_count : lnum; - - // Start a forward search at the end of the line (unless - // before the first line). --- -2.27.0 - diff --git a/backport-CVE-2021-3903.patch b/backport-CVE-2021-3903.patch deleted file mode 100644 index 98f34c5fb3dd674e33e9e2e4fc85035c28ad6d1e..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3903.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 777e7c21b7627be80961848ac560cb0a9978ff43 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 25 Oct 2021 17:07:04 +0100 -Subject: [PATCH] patch 8.2.3564: invalid memory access when scrolling without - valid screen - -Problem: Invalid memory access when scrolling without a valid screen. -Solution: Do not set VALID_BOTLINE in w_valid. ---- - src/move.c | 1 - - src/testdir/test_normal.vim | 22 +++++++++++++++++++--- - 2 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/src/move.c b/src/move.c -index 8e53d8b..10165ef 100644 ---- a/src/move.c -+++ b/src/move.c -@@ -198,7 +198,6 @@ update_topline(void) - { - curwin->w_topline = curwin->w_cursor.lnum; - curwin->w_botline = curwin->w_topline; -- curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; - curwin->w_scbind_pos = 1; - return; - } -diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim -index d45cf41..1f0088a 100644 ---- a/src/testdir/test_normal.vim -+++ b/src/testdir/test_normal.vim -@@ -33,14 +33,14 @@ func CountSpaces(type, ...) - else - silent exe "normal! `[v`]y" - endif -- let g:a=strlen(substitute(@@, '[^ ]', '', 'g')) -+ let g:a = strlen(substitute(@@, '[^ ]', '', 'g')) - let &selection = sel_save - let @@ = reg_save - endfunc - - func OpfuncDummy(type, ...) - " for testing operatorfunc -- let g:opt=&linebreak -+ let g:opt = &linebreak - - if a:0 " Invoked from Visual mode, use gv command. - silent exe "normal! gvy" -@@ -51,7 +51,7 @@ func OpfuncDummy(type, ...) - endif - " Create a new dummy window - new -- let g:bufnr=bufnr('%') -+ let g:bufnr = bufnr('%') - endfunc - - fun! Test_normal00_optrans() -@@ -2705,3 +2705,19 @@ func Test_normal_gk() - bw! - set cpoptions& number& numberwidth& - endfunc -+ -+func Test_scroll_in_ex_mode() -+ " This was using invalid memory because w_botline was invalid. -+ let lines =<< trim END -+ diffsplit -+ norm os00( -+ call writefile(['done'], 'Xdone') -+ qa! -+ END -+ call writefile(lines, 'Xscript') -+ call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript')) -+ call assert_equal(['done'], readfile('Xdone')) -+ -+ call delete('Xscript') -+ call delete('Xdone') -+endfunc --- -1.8.3.1 - diff --git a/backport-CVE-2021-3927.patch b/backport-CVE-2021-3927.patch deleted file mode 100644 index 11fc0a9d3236f6908b10e6e32489f42c96e13662..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3927.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0b5b06cb4777d1401fdf83e7d48d287662236e7e Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 4 Nov 2021 15:10:11 +0000 -Subject: [PATCH] patch 8.2.3581: reading character past end of line - -Problem: Reading character past end of line. -Solution: Correct the cursor column. ---- - src/ex_docmd.c | 1 + - src/testdir/test_put.vim | 9 +++++++++ - 2 files changed, 10 insertions(+) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index 12554fa..203174a 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -6906,6 +6906,7 @@ ex_put(exarg_T *eap) - eap->forceit = TRUE; - } - curwin->w_cursor.lnum = eap->line2; -+ check_cursor_col(); - do_put(eap->regname, eap->forceit ? BACKWARD : FORWARD, 1L, - PUT_LINE|PUT_CURSLINE); - } -diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim -index 225ebd1..f5037dc 100644 ---- a/src/testdir/test_put.vim -+++ b/src/testdir/test_put.vim -@@ -113,3 +113,12 @@ func Test_put_p_indent_visual() - call assert_equal('select that text', getline(2)) - bwipe! - endfunc -+ -+func Test_put_above_first_line() -+ new -+ let @" = 'text' -+ silent! normal 0o00 -+ 0put -+ call assert_equal('text', getline(1)) -+ bwipe! -+endfunc --- -1.8.3.1 - diff --git a/backport-CVE-2021-3928.patch b/backport-CVE-2021-3928.patch deleted file mode 100644 index 5a96fdad03c214dde5eff62ab5459c4f63b8cd11..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3928.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 15d9890eee53afc61eb0a03b878a19cb5672f732 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 4 Nov 2021 15:46:05 +0000 -Subject: [PATCH] patch 8.2.3582: reading uninitialized memory when giving - spell suggestions - -Problem: Reading uninitialized memory when giving spell suggestions. -Solution: Check that preword is not empty. ---- - src/spellsuggest.c | 2 +- - src/testdir/test_spell.vim | 8 ++++++++ - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/spellsuggest.c b/src/spellsuggest.c -index 9d6df79..8615d52 100644 ---- a/src/spellsuggest.c -+++ b/src/spellsuggest.c -@@ -1600,7 +1600,7 @@ suggest_trie_walk( - // char, e.g., "thes," -> "these". - p = fword + sp->ts_fidx; - MB_PTR_BACK(fword, p); -- if (!spell_iswordp(p, curwin)) -+ if (!spell_iswordp(p, curwin) && *preword != NUL) - { - p = preword + STRLEN(preword); - MB_PTR_BACK(preword, p); -diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index 79fb892..e435e91 100644 ---- a/src/testdir/test_spell.vim -+++ b/src/testdir/test_spell.vim -@@ -498,6 +498,14 @@ func Test_spell_screendump() - call delete('XtestSpell') - endfunc - -+func Test_spell_single_word() -+ new -+ silent! norm 0R00 -+ spell! ß -+ silent 0norm 0r$ Dvz= -+ bwipe! -+endfunc -+ - let g:test_data_aff1 = [ - \"SET ISO8859-1", - \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", --- -1.8.3.1 - diff --git a/backport-CVE-2021-3973.patch b/backport-CVE-2021-3973.patch deleted file mode 100644 index cda4be3b14f600112c0321c1d519a47c3470d3b4..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3973.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 615ddd5342b50a6878a907062aa471740bd9a847 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 17 Nov 2021 18:00:31 +0000 -Subject: [PATCH] patch 8.2.3611: crash when using CTRL-W f without finding a - file name - -Problem: Crash when using CTRL-W f without finding a file name. -Solution: Bail out when the file name length is zero. - -Reference:https://github.com/vim/vim/commit/615ddd5342b50a6878a907062aa471740bd9a847 ---- - src/findfile.c | 8 ++++++++ - src/normal.c | 6 ++++-- - src/testdir/test_visual.vim | 8 ++++++++ - 3 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/src/findfile.c b/src/findfile.c -index ba996c4..7a4dfe5 100644 ---- a/src/findfile.c -+++ b/src/findfile.c -@@ -1727,6 +1727,9 @@ find_file_in_path_option( - proc->pr_WindowPtr = (APTR)-1L; - # endif - -+ if (len == 0) -+ return NULL; -+ - if (first == TRUE) - { - // copy file name into NameBuff, expanding environment variables -@@ -2103,7 +2106,12 @@ find_file_name_in_path( - int c; - # if defined(FEAT_FIND_ID) && defined(FEAT_EVAL) - char_u *tofree = NULL; -+# endif - -+ if (len == 0) -+ return NULL; -+ -+# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL) - if ((options & FNAME_INCL) && *curbuf->b_p_inex != NUL) - { - tofree = eval_includeexpr(ptr, len); -diff --git a/src/normal.c b/src/normal.c -index d6333b9..e9e587d 100644 ---- a/src/normal.c -+++ b/src/normal.c -@@ -3778,8 +3778,10 @@ get_visual_text( - *pp = ml_get_pos(&VIsual); - *lenp = curwin->w_cursor.col - VIsual.col + 1; - } -- if (has_mbyte) -- // Correct the length to include the whole last character. -+ if (**pp == NUL) -+ *lenp = 0; -+ if (has_mbyte && *lenp > 0) -+ // Correct the length to include all bytes of the last character. - *lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1; - } - reset_VIsual_and_resel(); -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index ae28123..0705fdb 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -894,4 +894,12 @@ func Test_block_insert_replace_tabs() - bwipe! - endfunc - -+func Test_visual_block_ctrl_w_f() -+ " Emtpy block selected in new buffer should not result in an error. -+ au! BufNew foo sil norm f -+ edit foo -+ -+ au! BufNew -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -2.23.0 \ No newline at end of file diff --git a/backport-CVE-2021-3974.patch b/backport-CVE-2021-3974.patch deleted file mode 100644 index 258270483e5a66c182bc88f4cc2a59cd836aa9f1..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3974.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 64066b9acd9f8cffdf4840f797748f938a13f2d6 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 17 Nov 2021 18:22:56 +0000 -Subject: [PATCH] patch 8.2.3612: using freed memory with regexp using a mark - -Problem: Using freed memory with regexp using a mark. -Solution: Get the line again after getting the mark position. - -Reference:https://github.com/vim/vim/commit/64066b9acd9f8cffdf4840f797748f938a13f2d6 ---- - src/regexp.c | 2 +- - src/regexp_nfa.c | 8 ++++++++ - src/testdir/test_regexp_latin.vim | 8 ++++++++ - 3 files changed, 17 insertions(+), 1 deletion(-) - -diff --git a/src/regexp.c b/src/regexp.c -index 112f753..2e94e5a 100644 ---- a/src/regexp.c -+++ b/src/regexp.c -@@ -1092,7 +1092,7 @@ typedef struct { - // The current match-position is stord in these variables: - linenr_T lnum; // line number, relative to first line - char_u *line; // start of current line -- char_u *input; // current input, points into "regline" -+ char_u *input; // current input, points into "line" - - int need_clear_subexpr; // subexpressions still need to be cleared - #ifdef FEAT_SYN_HL -diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c -index bc4a4b6..433523e 100644 ---- a/src/regexp_nfa.c -+++ b/src/regexp_nfa.c -@@ -6623,8 +6623,16 @@ nfa_regmatch( - case NFA_MARK_GT: - case NFA_MARK_LT: - { -+ size_t col = rex.input - rex.line; - pos_T *pos = getmark_buf(rex.reg_buf, t->state->val, FALSE); - -+ // Line may have been freed, get it again. -+ if (REG_MULTI) -+ { -+ rex.line = reg_getline(rex.lnum); -+ rex.input = rex.line + col; -+ } -+ - // Compare the mark position to the match position. - result = (pos != NULL // mark doesn't exist - && pos->lnum > 0 // mark isn't set in reg_buf -diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim -index 7a4d98f..3168edc 100644 ---- a/src/testdir/test_regexp_latin.vim -+++ b/src/testdir/test_regexp_latin.vim -@@ -141,3 +141,11 @@ func Test_pattern_compile_speed() - call assert_inrange(0.01, 10.0, reltimefloat(reltime(start))) - set spc= - endfunc -+ -+func Test_using_mark_position() -+ " this was using freed memory -+ new -+ norm O0 -+ call assert_fails("s/\\%')", 'E486:') -+ bwipe! -+endfunc --- -2.23.0 \ No newline at end of file diff --git a/backport-CVE-2021-3984.patch b/backport-CVE-2021-3984.patch deleted file mode 100644 index cf8fd05237085a77f8a077f8d826bf5da7e90a3a..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-3984.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 2de9b7c7c8791da8853a9a7ca9c467867465b655 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 19 Nov 2021 19:41:13 +0000 -Subject: [PATCH] patch 8.2.3625: illegal memory access when C-indenting - -Problem: Illegal memory access when C-indenting. -Solution: Also set the cursor column. ---- - src/cindent.c | 10 +++++----- - src/testdir/test_cindent.vim | 12 ++++++++++++ - 2 files changed, 17 insertions(+), 5 deletions(-) - -diff --git a/src/cindent.c b/src/cindent.c -index c7caed6..28d1558 100644 ---- a/src/cindent.c -+++ b/src/cindent.c -@@ -1635,10 +1635,10 @@ get_baseclass_amount(int col) - static pos_T * - find_start_brace(void) // XXX - { -- pos_T cursor_save; -- pos_T *trypos; -- pos_T *pos; -- static pos_T pos_copy; -+ pos_T cursor_save; -+ pos_T *trypos; -+ pos_T *pos; -+ static pos_T pos_copy; - - cursor_save = curwin->w_cursor; - while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL) -@@ -1652,7 +1652,7 @@ find_start_brace(void) // XXX - && (pos = ind_find_start_CORS(NULL)) == NULL) // XXX - break; - if (pos != NULL) -- curwin->w_cursor.lnum = pos->lnum; -+ curwin->w_cursor = *pos; - } - curwin->w_cursor = cursor_save; - return trypos; -diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim -index 2cb3f24..2a87460 100644 ---- a/src/testdir/test_cindent.vim -+++ b/src/testdir/test_cindent.vim -@@ -5251,4 +5251,16 @@ func Test_cindent_56() - enew! | close - endfunc - -+func Test_find_brace_backwards() -+ " this was looking beyond the end of the line -+ new -+ norm R/* -+ norm o0{ -+ norm o// -+ norm V{= -+ call assert_equal(['/*', ' 0{', '//'], getline(1, 3)) -+ bwipe! -+endfunc -+ -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2021-4019.patch b/backport-CVE-2021-4019.patch deleted file mode 100644 index 590cdde961210457df365b6c5604567ee6e83982..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-4019.patch +++ /dev/null @@ -1,45 +0,0 @@ -From bd228fd097b41a798f90944b5d1245eddd484142 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 25 Nov 2021 10:50:12 +0000 -Subject: [PATCH] patch 8.2.3669: buffer overflow with long help argument - -Problem: Buffer overflow with long help argument. -Solution: Use snprintf(). ---- - src/ex_cmds.c | 3 +-- - src/testdir/test_help.vim | 8 ++++++++ - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index 45c733b..8f6444f 100644 ---- a/src/ex_cmds.c -+++ b/src/ex_cmds.c -@@ -5436,8 +5436,7 @@ find_help_tags( - || (vim_strchr((char_u *)"%_z@", arg[1]) != NULL - && arg[2] != NUL))) - { -- STRCPY(d, "/\\\\"); -- STRCPY(d + 3, arg + 1); -+ vim_snprintf((char *)d, IOSIZE, "/\\\\%s", arg + 1); - // Check for "/\\_$", should be "/\\_\$" - if (d[3] == '_' && d[4] == '$') - STRCPY(d + 4, "\\$"); -diff --git a/src/testdir/test_help.vim b/src/testdir/test_help.vim -index 5dd937a..c2aeb1f 100644 ---- a/src/testdir/test_help.vim -+++ b/src/testdir/test_help.vim -@@ -55,3 +55,11 @@ func Test_help_local_additions() - call delete('Xruntime', 'rf') - let &rtp = rtp_save - endfunc -+ -+func Test_help_long_argument() -+ try -+ exe 'help \%' .. repeat('0', 1021) -+ catch -+ call assert_match("E149:", v:exception) -+ endtry -+endfunc --- -1.8.3.1 - diff --git a/backport-CVE-2021-4069.patch b/backport-CVE-2021-4069.patch deleted file mode 100644 index cefd77889663569f977b42c094419ef316a236d7..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-4069.patch +++ /dev/null @@ -1,56 +0,0 @@ -From e031fe90cf2e375ce861ff5e5e281e4ad229ebb9 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 5 Dec 2021 12:06:24 +0000 -Subject: [PATCH] patch 8.2.3741: using freed memory in open command - -Problem: Using freed memory in open command. -Solution: Make a copy of the current line. - -Reference:https://github.com/vim/vim/commit/e031fe90cf2e375ce861ff5e5e281e4ad229ebb9 -Conflict:src/testdir/test_ex_mode.vim, The current version does not exist and therefore does not fit into this test case ---- - src/ex_docmd.c | 10 +++++++--- - src/version.c | 2 ++ - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index 203174a..cb6b64a 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -6030,13 +6030,17 @@ ex_open(exarg_T *eap) - regmatch.regprog = vim_regcomp(eap->arg, p_magic ? RE_MAGIC : 0); - if (regmatch.regprog != NULL) - { -+ // make a copy of the line, when searching for a mark it might be -+ // flushed -+ char_u *line = vim_strsave(ml_get_curline()); -+ - regmatch.rm_ic = p_ic; -- p = ml_get_curline(); -- if (vim_regexec(®match, p, (colnr_T)0)) -- curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p); -+ if (vim_regexec(®match, line, (colnr_T)0)) -+ curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - line); - else - emsg(_(e_nomatch)); - vim_regfree(regmatch.regprog); -+ vim_free(line); - } - // Move to the NUL, ignore any other arguments. - eap->arg += STRLEN(eap->arg); -diff --git a/src/version.c b/src/version.c -index 035c46f..bd45631 100644 ---- a/src/version.c -+++ b/src/version.c -@@ -742,6 +742,8 @@ static char *(features[]) = - - static int included_patches[] = - { /* Add new patch number below this line */ -+/**/ -+ 3741, - /**/ - 3403, - /**/ --- -2.27.0 - diff --git a/backport-CVE-2021-4166.patch b/backport-CVE-2021-4166.patch deleted file mode 100644 index 7de8faac7ad9a896232e26a28af1ce6c8664df6a..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-4166.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 6f98371532fcff911b462d51bc64f2ce8a6ae682 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 24 Dec 2021 18:11:27 +0000 -Subject: [PATCH] patch 8.2.3884: crash when clearing the argument list while - using it -Conflict:NA -Reference:https://github.com/vim/vim/commit/6f98371532fcff911b462d51bc64f2ce8a6ae682 - -Problem: Crash when clearing the argument list while using it. -Solution: Lock the argument list for ":all". ---- - src/arglist.c | 3 +++ - src/testdir/test_arglist.vim | 7 +++++++ - 2 files changed, 10 insertions(+) - -diff --git a/src/arglist.c b/src/arglist.c -index 21c38c1..cdd70ca 100644 ---- a/src/arglist.c -+++ b/src/arglist.c -@@ -902,6 +902,7 @@ do_arg_all( - tabpage_T *old_curtab, *last_curtab; - win_T *new_curwin = NULL; - tabpage_T *new_curtab = NULL; -+ int prev_arglist_locked = arglist_locked; - - if (ARGCOUNT <= 0) - { -@@ -921,6 +922,7 @@ do_arg_all( - // watch out for its size to be changed. - alist = curwin->w_alist; - ++alist->al_refcount; -+ arglist_locked = TRUE; - - old_curwin = curwin; - old_curtab = curtab; -@@ -1132,6 +1134,7 @@ do_arg_all( - - // Remove the "lock" on the argument list. - alist_unlink(alist); -+ arglist_locked = prev_arglist_locked; - - --autocmd_no_enter; - -diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim -index c486b18..1c94fe9 100644 ---- a/src/testdir/test_arglist.vim -+++ b/src/testdir/test_arglist.vim -@@ -505,3 +505,10 @@ func Test_argdo() - call assert_equal(['Xa.c', 'Xb.c', 'Xc.c'], l) - bwipe Xa.c Xb.c Xc.c - endfunc -+ -+func Test_clear_arglist_in_all() -+ n 0 00 000 0000 00000 000000 -+ au! * 0 n 0 -+ all -+ au! * -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2021-4192.patch b/backport-CVE-2021-4192.patch deleted file mode 100644 index 68231b30a5b59e966290ffd0f15190812d07fd4d..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-4192.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 4c13e5e6763c6eb36a343a2b8235ea227202e952 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 30 Dec 2021 14:49:43 +0000 -Subject: [PATCH] patch 8.2.3949: using freed memory with /\%V -Conflict:NA -Reference:https://github.com/vim/vim/commit/4c13e5e6763c6eb36a343a2b8235ea227202e952 - -Problem: Using freed memory with /\%V. -Solution: Get the line again after getvvcol(). ---- - src/regexp.c | 9 +++++++-- - src/testdir/test_regexp_latin.vim | 8 ++++++++ - 2 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/src/regexp.c b/src/regexp.c -index 2e94e5a..6849cba 100644 ---- a/src/regexp.c -+++ b/src/regexp.c -@@ -1276,9 +1276,9 @@ reg_match_visual(void) - if (lnum < top.lnum || lnum > bot.lnum) - return FALSE; - -+ col = (colnr_T)(rex.input - rex.line); - if (mode == 'v') - { -- col = (colnr_T)(rex.input - rex.line); - if ((lnum == top.lnum && col < top.col) - || (lnum == bot.lnum && col >= bot.col + (*p_sel != 'e'))) - return FALSE; -@@ -1293,7 +1293,12 @@ reg_match_visual(void) - end = end2; - if (top.col == MAXCOL || bot.col == MAXCOL) - end = MAXCOL; -- cols = win_linetabsize(wp, rex.line, (colnr_T)(rex.input - rex.line)); -+ -+ // getvvcol() flushes rex.line, need to get it again -+ rex.line = reg_getline(rex.lnum); -+ rex.input = rex.line + col; -+ -+ cols = win_linetabsize(wp, rex.line, col); - if (cols < start || cols > end - (*p_sel == 'e')) - return FALSE; - } -diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim -index 3168edc..044b678 100644 ---- a/src/testdir/test_regexp_latin.vim -+++ b/src/testdir/test_regexp_latin.vim -@@ -39,6 +39,14 @@ func Test_recursive_substitute() - bwipe! - endfunc - -+func Test_using_visual_position() -+ " this was using freed memory -+ new -+ exe "norm 0o\\k\o0" -+ /\%V -+ bwipe! -+endfunc -+ - func Test_nested_backrefs() - " Check example in change.txt. - new --- -2.27.0 - diff --git a/backport-CVE-2021-4193.patch b/backport-CVE-2021-4193.patch deleted file mode 100644 index dbe489683195766079a242619ea092f93d7f9d46..0000000000000000000000000000000000000000 --- a/backport-CVE-2021-4193.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 94f3192b03ed27474db80b4d3a409e107140738b Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 30 Dec 2021 15:29:18 +0000 -Subject: [PATCH] patch 8.2.3950: going beyond the end of the line with /\%V -Conflict:NA -Reference:https://github.com/vim/vim/commit/94f3192b03ed27474db80b4d3a409e107140738b - -Problem: Going beyond the end of the line with /\%V. -Solution: Check for valid column in getvcol(). - ---- - src/charset.c | 13 +++++++++---- - src/testdir/test_regexp_latin.vim | 8 ++++++++ - 2 files changed, 17 insertions(+), 4 deletions(-) - -diff --git a/src/charset.c b/src/charset.c -index 7505fea..a768c17 100644 ---- a/src/charset.c -+++ b/src/charset.c -@@ -1226,10 +1226,15 @@ getvcol( - posptr = NULL; // continue until the NUL - else - { -- // Special check for an empty line, which can happen on exit, when -- // ml_get_buf() always returns an empty string. -- if (*ptr == NUL) -- pos->col = 0; -+ colnr_T i; -+ -+ // In a few cases the position can be beyond the end of the line. -+ for (i = 0; i < pos->col; ++i) -+ if (ptr[i] == NUL) -+ { -+ pos->col = i; -+ break; -+ } - posptr = ptr + pos->col; - if (has_mbyte) - // always start on the first byte -diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim -index 3168edc..4f52bac 100644 ---- a/src/testdir/test_regexp_latin.vim -+++ b/src/testdir/test_regexp_latin.vim -@@ -149,3 +149,11 @@ func Test_using_mark_position() - call assert_fails("s/\\%')", 'E486:') - bwipe! - endfunc -+ -+func Test_using_invalid_visual_position() -+ " this was going beyond the end of the line -+ new -+ exe "norm 0o000\0\$s0" -+ /\%V -+ bwipe! -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2022-0213.patch b/backport-CVE-2022-0213.patch deleted file mode 100644 index 0324ad85f22d2fa4f0929585a583406dada0f7cc..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0213.patch +++ /dev/null @@ -1,62 +0,0 @@ -From de05bb25733c3319e18dca44e9b59c6ee389eb26 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 13 Jan 2022 13:08:14 +0000 -Subject: [PATCH] patch 8.2.4074: going over the end of NameBuff - -Problem: Going over the end of NameBuff. -Solution: Check length when appending a space. - ---- - src/drawscreen.c | 9 +++++---- - src/testdir/test_edit.vim | 15 +++++++++++++++ - src/version.c | 2 ++ - 3 files changed, 22 insertions(+), 4 deletions(-) - -diff --git a/src/drawscreen.c b/src/drawscreen.c -index 9acb705..7425ad4 100644 ---- a/src/drawscreen.c -+++ b/src/drawscreen.c -@@ -437,12 +437,13 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) - p = NameBuff; - len = (int)STRLEN(p); - -- if (bt_help(wp->w_buffer) -+ if ((bt_help(wp->w_buffer) - #ifdef FEAT_QUICKFIX -- || wp->w_p_pvw -+ || wp->w_p_pvw - #endif -- || bufIsChanged(wp->w_buffer) -- || wp->w_buffer->b_p_ro) -+ || bufIsChanged(wp->w_buffer) -+ || wp->w_buffer->b_p_ro) -+ && len < MAXPATHL - 1) - *(p + len++) = ' '; - if (bt_help(wp->w_buffer)) - { -diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim -index c3b1af5..48e6ff2 100644 ---- a/src/testdir/test_edit.vim -+++ b/src/testdir/test_edit.vim -@@ -1532,3 +1532,18 @@ func Test_edit_put_CTRL_E() - set encoding=utf-8 - endfunc - -+" Weird long file name was going over the end of NameBuff -+func Test_edit_overlong_file_name() -+ CheckUnix -+ -+ file 0000000000000000000000000000 -+ file %%%%%%%%%%%%%%%%%%%%%%%%%% -+ file %%%%%% -+ set readonly -+ set ls=2 -+ -+ redraw! -+ set noreadonly ls& -+ bwipe! -+endfunc -+ --- -2.23.0 - diff --git a/backport-CVE-2022-0261.patch b/backport-CVE-2022-0261.patch deleted file mode 100644 index f5c2e76931d4ad626fd868f5122baf35147b6c1b..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0261.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 9f8c304c8a390ade133bac29963dc8e56ab14cbc Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 17 Jan 2022 17:30:21 +0000 -Subject: [PATCH] patch 8.2.4120: block insert goes over the end of the line - -Problem: Block insert goes over the end of the line. -Solution: Handle invalid byte better. Fix inserting the wrong text. ---- - src/ops.c | 40 ++++++++++++++++++++++++------------- - src/testdir/test_visual.vim | 10 ++++++++++ - 2 files changed, 36 insertions(+), 14 deletions(-) - -diff --git a/src/ops.c b/src/ops.c -index d3e1e47..13e6bdb 100644 ---- a/src/ops.c -+++ b/src/ops.c -@@ -535,22 +535,27 @@ block_insert( - if (b_insert) - { - off = (*mb_head_off)(oldp, oldp + offset + spaces); -+ spaces -= off; -+ count -= off; - } - else - { -- off = (*mb_off_next)(oldp, oldp + offset); -- offset += off; -+ // spaces fill the gap, the character that's at the edge moves -+ // right -+ off = (*mb_head_off)(oldp, oldp + offset); -+ offset -= off; - } -- spaces -= off; -- count -= off; - } - -- newp = alloc(STRLEN(oldp) + s_len + count + 1); -+ // Make sure the allocated size matches what is actually copied below. -+ newp = alloc(STRLEN(oldp) + spaces + s_len -+ + (spaces > 0 && !bdp->is_short ? ts_val - spaces : 0) -+ + count + 1); - if (newp == NULL) - continue; - - // copy up to shifted part -- mch_memmove(newp, oldp, (size_t)(offset)); -+ mch_memmove(newp, oldp, (size_t)offset); - oldp += offset; - - // insert pre-padding -@@ -560,14 +565,21 @@ block_insert( - mch_memmove(newp + offset + spaces, s, (size_t)s_len); - offset += s_len; - -- if (spaces && !bdp->is_short) -+ if (spaces > 0 && !bdp->is_short) - { -- // insert post-padding -- vim_memset(newp + offset + spaces, ' ', (size_t)(ts_val - spaces)); -- // We're splitting a TAB, don't copy it. -- oldp++; -- // We allowed for that TAB, remember this now -- count++; -+ if (*oldp == TAB) -+ { -+ // insert post-padding -+ vim_memset(newp + offset + spaces, ' ', -+ (size_t)(ts_val - spaces)); -+ // we're splitting a TAB, don't copy it -+ oldp++; -+ // We allowed for that TAB, remember this now -+ count++; -+ } -+ else -+ // Not a TAB, no extra spaces -+ count = spaces; - } - - if (spaces > 0) -@@ -1609,7 +1621,7 @@ op_insert(oparg_T *oap, long count1) - oap->start_vcol = t; - } - else if (oap->op_type == OP_APPEND -- && oap->end.col + oap->end.coladd -+ && oap->start.col + oap->start.coladd - >= curbuf->b_op_start_orig.col - + curbuf->b_op_start_orig.coladd) - { -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 0705fdb..84a8981 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -903,3 +903,13 @@ func Test_visual_block_ctrl_w_f() - endfunc - - " vim: shiftwidth=2 sts=2 expandtab -+ -+func Test_visual_block_append_invalid_char() -+ " this was going over the end of the line -+ new -+ call setline(1, [' let xxx', 'xxxxxˆ', 'xxxxxxxxxxx']) -+ exe "normal 0\jjA-\" -+ call assert_equal([' - let xxx', 'xxxxx -ˆ', 'xxxxxxxx-xxx'], getline(1, 3)) -+ bwipe! -+endfunc -+ --- -2.27.0 - diff --git a/backport-CVE-2022-0318.patch b/backport-CVE-2022-0318.patch deleted file mode 100644 index 2a062f8aca26f7854680f9c8f958c9488d95e287..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0318.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 57df9e8a9f9ae1aafdde9b86b10ad907627a87dc Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 20 Jan 2022 12:10:48 +0000 -Subject: [PATCH] patch 8.2.4151: reading beyond the end of a line - -Problem: Reading beyond the end of a line. -Solution: For block insert only use the offset for correcting the length. ---- - src/ops.c | 20 ++------------------ - src/testdir/test_visual.vim | 9 +++++++++ - 2 files changed, 11 insertions(+), 18 deletions(-) - -diff --git a/src/ops.c b/src/ops.c -index 13e6bdb..2122ff3 100644 ---- a/src/ops.c -+++ b/src/ops.c -@@ -528,24 +528,8 @@ block_insert( - } - - if (has_mbyte && spaces > 0) -- { -- int off; -- -- // Avoid starting halfway a multi-byte character. -- if (b_insert) -- { -- off = (*mb_head_off)(oldp, oldp + offset + spaces); -- spaces -= off; -- count -= off; -- } -- else -- { -- // spaces fill the gap, the character that's at the edge moves -- // right -- off = (*mb_head_off)(oldp, oldp + offset); -- offset -= off; -- } -- } -+ // avoid copying part of a multi-byte character -+ offset -= (*mb_head_off)(oldp, oldp + offset); - - // Make sure the allocated size matches what is actually copied below. - newp = alloc(STRLEN(oldp) + spaces + s_len -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 84a8981..3ed927a 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -913,3 +913,12 @@ func Test_visual_block_append_invalid_char() - bwipe! - endfunc - -+func Test_visual_block_insert_round_off() -+ new -+ " The number of characters are tuned to fill a 4096 byte allocated block, -+ " so that valgrind reports going over the end. -+ call setline(1, ['xxxxx', repeat('0', 1350), "\t", repeat('x', 60)]) -+ exe "normal gg0\GI" .. repeat('0', 1320) .. "\" -+ bwipe! -+endfunc -+ --- -2.27.0 - diff --git a/backport-CVE-2022-0319.patch b/backport-CVE-2022-0319.patch deleted file mode 100644 index 8bb828f953b5c5b7a2aec5ccfe4018187f08042f..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0319.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 05b27615481e72e3b338bb12990fb3e0c2ecc2a9 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 20 Jan 2022 13:32:50 +0000 -Subject: [PATCH] patch 8.2.4154: ml_get error when exchanging windows in - Visual mode - -Problem: ml_get error when exchanging windows in Visual mode. -Solution: Correct end of Visual area when entering another buffer - -Reference:https://github.com/vim/vim/commit/05b27615481e72e3b338bb12990fb3e0c2ecc2a9 -Conflict:NA ---- - src/testdir/test_visual.vim | 10 ++++++++++ - src/window.c | 7 ++++++- - 2 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index fcf6473..4f8f056 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -705,6 +705,16 @@ func Test_visual_undo_deletes_last_line() - bwipe! - endfunc - -+" this was causing an ml_get error -+func Test_visual_exchange_windows() -+ enew! -+ new -+ call setline(1, ['foo', 'bar']) -+ exe "normal G\gg\\OO\" -+ bwipe! -+ bwipe! -+endfunc -+ - func Test_visual_mode_put() - new - -diff --git a/src/window.c b/src/window.c -index 5b407d5..bb17167 100644 ---- a/src/window.c -+++ b/src/window.c -@@ -1661,6 +1661,11 @@ win_exchange(long Prenum) - - (void)win_comp_pos(); // recompute window positions - -+ if (wp->w_buffer != curbuf) -+ reset_VIsual_and_resel(); -+ else if (VIsual_active) -+ wp->w_cursor = curwin->w_cursor; -+ - win_enter(wp, TRUE); - redraw_all_later(NOT_VALID); - } -@@ -5114,7 +5119,7 @@ frame_remove(frame_T *frp) - win_alloc_lines(win_T *wp) - { - wp->w_lines_valid = 0; -- wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows ); -+ wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows); - if (wp->w_lines == NULL) - return FAIL; - return OK; --- -2.27.0 - diff --git a/backport-CVE-2022-0351.patch b/backport-CVE-2022-0351.patch deleted file mode 100644 index fdda8ed5ccb5466b5ef2e88e891313b74d9ce653..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0351.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: Bram Moolenaar -Date: Mon, 24 Jan 2022 18:16:12 +0000 -Subject: [PATCH] patch 8.2.4206: condition with many "(" causes a crash - -Problem: Condition with many "(" causes a crash. -Solution: Limit recursion to 1000. ---- - src/eval.c | 12 ++++++++++++ - src/globals.h | 2 ++ - src/testdir/test_eval_stuff.vim | 5 +++++ - 3 files changed, 19 insertions(+) - -diff --git a/src/eval.c b/src/eval.c -index 3b563f7..95dda90 100644 ---- a/src/eval.c -+++ b/src/eval.c -@@ -2495,6 +2495,7 @@ eval7( - char_u *start_leader, *end_leader; - int ret = OK; - char_u *alias; -+ static int recurse = 0; - - /* - * Initialise variable so that clear_tv() can't mistake this for a -@@ -2521,6 +2522,15 @@ eval7( - return FAIL; - } - -+ // Limit recursion to 1000 levels. At least at 10000 we run out of stack -+ // and crash. -+ if (recurse == 1000) -+ { -+ semsg(_(e_expression_too_recursive_str), *arg); -+ return FAIL; -+ } -+ ++recurse; -+ - switch (**arg) - { - /* -@@ -2761,6 +2771,8 @@ eval7( - */ - if (ret == OK && evaluate && end_leader > start_leader) - ret = eval7_leader(rettv, start_leader, &end_leader); -+ -+ --recurse; - return ret; - } - -diff --git a/src/globals.h b/src/globals.h -index 75092b7..659bad6 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1464,6 +1464,8 @@ EXTERN char e_endwhile[] INIT(= N_("E170: Missing :endwhile")); - EXTERN char e_endfor[] INIT(= N_("E170: Missing :endfor")); - EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while")); - EXTERN char e_for[] INIT(= N_("E588: :endfor without :for")); -+EXTERN char e_expression_too_recursive_str[] -+ INIT(= N_("E1169: Expression too recursive: %s")); - #endif - EXTERN char e_exists[] INIT(= N_("E13: File exists (add ! to override)")); - EXTERN char e_failed[] INIT(= N_("E472: Command failed")); -diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim -index ec566da..32a5411 100644 ---- a/src/testdir/test_eval_stuff.vim -+++ b/src/testdir/test_eval_stuff.vim -@@ -216,3 +216,8 @@ func Test_scriptversion_fail() - call assert_fails('source Xversionscript', 'E999:') - call delete('Xversionscript') - endfunc -+ -+func Test_deep_recursion() -+ " this was running out of stack -+ call assert_fails("exe 'if ' .. repeat('(', 1002)", 'E1169: Expression too recursive: ((') -+endfunc --- -1.8.3.1 - diff --git a/backport-CVE-2022-0359.patch b/backport-CVE-2022-0359.patch deleted file mode 100644 index cd2f04b8a39e5acfe362e586cc3cafa034faa790..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0359.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 85b6747abc15a7a81086db31289cf1b8b17e6cb1 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 25 Jan 2022 11:55:02 +0000 -Subject: [PATCH] patch 8.2.4214: illegal memory access with large 'tabstop' in - Ex mode - -Problem: Illegal memory access with large 'tabstop' in Ex mode. -Solution: Allocate enough memory. ---- - src/ex_getln.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 769dcb8..68b4757 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -856,7 +856,7 @@ getcmdline_int( - ccline.cmdindent = (firstc > 0 ? indent : 0); - - // alloc initial ccline.cmdbuff -- alloc_cmdbuff(exmode_active ? 250 : indent + 1); -+ alloc_cmdbuff(indent + 50); - if (ccline.cmdbuff == NULL) - goto theend; // out of memory - ccline.cmdlen = ccline.cmdpos = 0; --- -1.8.3.1 - diff --git a/backport-CVE-2022-0361.patch b/backport-CVE-2022-0361.patch deleted file mode 100644 index c809606856afa628ffc5855961c796464ef2fedc..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0361.patch +++ /dev/null @@ -1,60 +0,0 @@ -From dc5490e2cbc8c16022a23b449b48c1bd0083f366 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 25 Jan 2022 13:52:53 +0000 -Subject: [PATCH] patch 8.2.4215: illegal memory access when copying lines in - Visual mode - -Problem: Illegal memory access when copying lines in Visual mode. -Solution: Adjust the Visual position after copying lines. ---- - src/ex_cmds.c | 2 ++ - src/testdir/test_visual.vim | 13 +++++++++++-- - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index fea6dfa..aa97b40 100644 ---- a/src/ex_cmds.c -+++ b/src/ex_cmds.c -@@ -864,6 +864,8 @@ ex_copy(linenr_T line1, linenr_T line2, linenr_T n) - } - - appended_lines_mark(n, count); -+ if (VIsual_active) -+ check_pos(curbuf, &VIsual); - - msgmore((long)count); - } -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 3ed927a..f82d75b 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -658,8 +658,6 @@ func Test_linewise_select_mode() - call append('$', ['a', 'b', 'c']) - exe "normal GkkgH\" - call assert_equal(['', 'b', 'c'], getline(1, '$')) -- -- - " linewise select mode: delete middle two lines - call deletebufline('', 1, '$') - call append('$', ['a', 'b', 'c']) -@@ -681,6 +679,17 @@ func Test_linewise_select_mode() - bwipe! - endfunc - -+" this was leaving the end of the Visual area beyond the end of a line -+func Test_visual_ex_copy_line() -+ new -+ call setline(1, ["aaa", "bbbbbbbbbxbb"]) -+ /x -+ exe "normal ggvjfxO" -+ t0 -+ normal gNU -+ bwipe! -+endfunc -+ - func Test_visual_mode_put() - new - --- -2.27.0 - diff --git a/backport-CVE-2022-0368.patch b/backport-CVE-2022-0368.patch deleted file mode 100644 index ed8cfac48e03287ff3639802f8b6015c0216434f..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0368.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 8d02ce1ed75d008c34a5c9aaa51b67cbb9d33baa Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 25 Jan 2022 18:24:00 +0000 -Subject: [PATCH] patch 8.2.4217: illegal memory access when undo makes Visual - area invalid - -Problem: Illegal memory access when undo makes Visual area invalid. -Solution: Correct the Visual area after undo. ---- - src/testdir/test_visual.vim | 15 +++++++++++++++ - src/undo.c | 2 ++ - 2 files changed, 17 insertions(+) - -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index f82d75b..fcf6473 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -690,6 +690,21 @@ func Test_visual_ex_copy_line() - bwipe! - endfunc - -+" This was leaving the end of the Visual area beyond the end of a line. -+" Set 'undolevels' to start a new undo block. -+func Test_visual_undo_deletes_last_line() -+ new -+ call setline(1, ["aaa", "ccc", "dyd"]) -+ set undolevels=100 -+ exe "normal obbbbbbbbbxbb\" -+ set undolevels=100 -+ /y -+ exe "normal ggvjfxO" -+ undo -+ normal gNU -+ bwipe! -+endfunc -+ - func Test_visual_mode_put() - new - -diff --git a/src/undo.c b/src/undo.c -index 54a6e1c..706dee9 100644 ---- a/src/undo.c -+++ b/src/undo.c -@@ -2985,6 +2985,8 @@ u_undo_end( - } - } - #endif -+ if (VIsual_active) -+ check_pos(curbuf, &VIsual); - - smsg_attr_keep(0, _("%ld %s; %s #%ld %s"), - u_oldcount < 0 ? -u_oldcount : u_oldcount, --- -2.27.0 - diff --git a/backport-CVE-2022-0392.patch b/backport-CVE-2022-0392.patch deleted file mode 100644 index b4f2c3ba2467906ba1de67fdb2ebc61a873ea22f..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0392.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 806d037671e133bd28a7864248763f643967973a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 25 Jan 2022 20:45:16 +0000 -Subject: [PATCH] patch 8.2.4218: illegal memory access with bracketed paste in - Ex mode - -Problem: Illegal memory access with bracketed paste in Ex mode. -Solution: Reserve space for the trailing NUL. - ---- - src/edit.c | 3 ++- - src/testdir/test_paste.vim | 11 +++++++++++ - 2 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/src/edit.c b/src/edit.c -index c67f67c..3767769 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -4984,7 +4984,8 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) - break; - - case PASTE_EX: -- if (gap != NULL && ga_grow(gap, idx) == OK) -+ // add one for the NUL that is going to be appended -+ if (gap != NULL && ga_grow(gap, idx + 1) == OK) - { - mch_memmove((char *)gap->ga_data + gap->ga_len, - buf, (size_t)idx); -diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim -index c30140f..263f084 100644 ---- a/src/testdir/test_paste.vim -+++ b/src/testdir/test_paste.vim -@@ -134,3 +134,14 @@ func Test_xrestore() - - bwipe! - endfunc -+ -+" bracketed paste in Ex-mode -+func Test_paste_ex_mode() -+ unlet! foo -+ call feedkeys("Qlet foo=\"\[200~foo\bar\[201~\"\vi\", 'xt') -+ call assert_equal("foo\rbar", foo) -+ -+ -+ " pasting more than 40 bytes -+ exe "norm Q\0000000000000000000000000000000000000000000000000000000000000000000000\" -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2022-0408.patch b/backport-CVE-2022-0408.patch deleted file mode 100644 index 7267533c7ad98b8a02d576e754714f27abb7f1b4..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0408.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 06f15416bb8d5636200a10776f1752c4d6e49f31 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 29 Jan 2022 10:51:59 +0000 -Subject: [PATCH] patch 8.2.4247: stack corruption when looking for spell - suggestions - -Problem: Stack corruption when looking for spell suggestions. -Solution: Prevent the depth increased too much. Add a five second time -limit to finding suggestions. ---- - src/spellsuggest.c | 17 +++++++++++++++-- - src/testdir/test_spell.vim | 8 ++++++++ - 2 files changed, 23 insertions(+), 2 deletions(-) - -diff --git a/src/spellsuggest.c b/src/spellsuggest.c -index 8615d52..a73e695 100644 ---- a/src/spellsuggest.c -+++ b/src/spellsuggest.c -@@ -1187,7 +1187,7 @@ suggest_try_change(suginfo_T *su) - - // Check the maximum score, if we go over it we won't try this change. - #define TRY_DEEPER(su, stack, depth, add) \ -- (stack[depth].ts_score + (add) < su->su_maxscore) -+ (depth < MAXWLEN && stack[depth].ts_score + (add) < su->su_maxscore) - - /* - * Try finding suggestions by adding/removing/swapping letters. -@@ -1259,6 +1259,9 @@ suggest_trie_walk( - char_u changename[MAXWLEN][80]; - #endif - int breakcheckcount = 1000; -+#ifdef FEAT_RELTIME -+ proftime_T time_limit; -+#endif - int compound_ok; - - // Go through the whole case-fold tree, try changes at each node. -@@ -1303,6 +1306,11 @@ suggest_trie_walk( - sp->ts_state = STATE_START; - } - } -+#ifdef FEAT_RELTIME -+ // The loop may take an indefinite amount of time. Break out after five -+ // sectonds. TODO: add an option for the time limit. -+ profile_setlimit(5000, &time_limit); -+#endif - - // Loop to find all suggestions. At each round we either: - // - For the current state try one operation, advance "ts_curi", -@@ -1337,7 +1345,8 @@ suggest_trie_walk( - - // At end of a prefix or at start of prefixtree: check for - // following word. -- if (byts[arridx] == 0 || n == (int)STATE_NOPREFIX) -+ if (depth < MAXWLEN -+ && (byts[arridx] == 0 || n == (int)STATE_NOPREFIX)) - { - // Set su->su_badflags to the caps type at this position. - // Use the caps type until here for the prefix itself. -@@ -2630,6 +2639,10 @@ suggest_trie_walk( - { - ui_breakcheck(); - breakcheckcount = 1000; -+#ifdef FEAT_RELTIME -+ if (profile_passed_limit(&time_limit)) -+ got_int = TRUE; -+#endif - } - } - } -diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index e435e91..271d034 100644 ---- a/src/testdir/test_spell.vim -+++ b/src/testdir/test_spell.vim -@@ -427,6 +427,14 @@ func Test_spell_long_word() - set nospell - endfunc - -+func Test_spellsuggest_too_deep() -+ " This was incrementing "depth" over MAXWLEN. -+ new -+ norm s000G00ý000000000000 -+ sil norm ..vzG................vvzG0 v z= -+ bwipe! -+endfunc -+ - func LoadAffAndDic(aff_contents, dic_contents) - set enc=latin1 - set spellfile= --- -1.8.3.1 - diff --git a/backport-CVE-2022-0413.patch b/backport-CVE-2022-0413.patch deleted file mode 100644 index dfc5fd41610f50f4c80b59cbaa939d99f85a1e21..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0413.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 37f47958b8a2a44abc60614271d9537e7f14e51a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 29 Jan 2022 14:21:51 +0000 -Subject: [PATCH] patch 8.2.4253: using freed memory when substitute with - function call - -Problem: Using freed memory when substitute uses a recursive function call. -Solution: Make a copy of the substitute text. ---- - src/ex_cmds.c | 19 +++++++++++++++---- - src/testdir/test_substitute.vim | 16 ++++++++++++++++ - 2 files changed, 31 insertions(+), 4 deletions(-) - -diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index cccdf47..aa97b40 100644 ---- a/src/ex_cmds.c -+++ b/src/ex_cmds.c -@@ -3577,6 +3577,7 @@ do_sub(exarg_T *eap) - int save_do_all; // remember user specified 'g' flag - int save_do_ask; // remember user specified 'c' flag - char_u *pat = NULL, *sub = NULL; // init for GCC -+ char_u *sub_copy = NULL; - int delimiter; - int sublen; - int got_quit = FALSE; -@@ -3866,11 +3867,20 @@ do_sub(exarg_T *eap) - sub_firstline = NULL; - - /* -- * ~ in the substitute pattern is replaced with the old pattern. -- * We do it here once to avoid it to be replaced over and over again. -- * But don't do it when it starts with "\=", then it's an expression. -+ * If the substitute pattern starts with "\=" then it's an expression. -+ * Make a copy, a recursive function may free it. -+ * Otherwise, '~' in the substitute pattern is replaced with the old -+ * pattern. We do it here once to avoid it to be replaced over and over -+ * again. - */ -- if (!(sub[0] == '\\' && sub[1] == '=')) -+ if (sub[0] == '\\' && sub[1] == '=') -+ { -+ sub = vim_strsave(sub); -+ if (sub == NULL) -+ return; -+ sub_copy = sub; -+ } -+ else - sub = regtilde(sub, p_magic); - - /* -@@ -4670,6 +4680,7 @@ outofmem: - #endif - - vim_regfree(regmatch.regprog); -+ vim_free(sub_copy); - - // Restore the flag values, they can be used for ":&&". - subflags.do_all = save_do_all; -diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim -index c7532fb..3e6bc5c 100644 ---- a/src/testdir/test_substitute.vim -+++ b/src/testdir/test_substitute.vim -@@ -745,3 +745,19 @@ func Test_sub_beyond_end() - call assert_equal('#', getline(1)) - bwipe! - endfunc -+ -+" This was using "old_sub" after it was freed. -+func Test_using_old_sub() -+ set compatible maxfuncdepth=10 -+ new -+ call setline(1, 'some text.') -+ func Repl() -+ ~ -+ s/ -+ endfunc -+ silent! s/\%')/\=Repl() -+ -+ delfunc Repl -+ bwipe! -+ set nocompatible -+endfunc --- -1.8.3.1 - diff --git a/backport-CVE-2022-0417.patch b/backport-CVE-2022-0417.patch deleted file mode 100644 index a96345952d7c5ba2397810f7e7d330e8d2e2e1ab..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0417.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 652dee448618589de5528a9e9a36995803f5557a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 28 Jan 2022 20:47:49 +0000 -Subject: [PATCH] patch 8.2.4245: ":retab 0" may cause illegal memory access - -Problem: ":retab 0" may cause illegal memory access. -Solution: Limit the value of 'tabstop' to 10000. - ---- - src/indent.c | 4 ++-- - src/option.c | 16 +++++++++------- - src/testdir/test_options.vim | 2 ++ - src/vim.h | 2 ++ - 4 files changed, 15 insertions(+), 9 deletions(-) - -diff --git a/src/indent.c b/src/indent.c -index 7d04373..e8e93b9 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -71,7 +71,7 @@ tabstop_set(char_u *var, int **array) - int n = atoi((char *)cp); - - // Catch negative values, overflow and ridiculous big values. -- if (n < 0 || n > 9999) -+ if (n < 0 || n > TABSTOP_MAX) - { - semsg(_(e_invarg2), cp); - vim_free(*array); -@@ -1590,7 +1590,7 @@ ex_retab(exarg_T *eap) - emsg(_(e_positive)); - return; - } -- if (new_ts < 0 || new_ts > 9999) -+ if (new_ts < 0 || new_ts > TABSTOP_MAX) - { - semsg(_(e_invarg2), eap->arg); - return; -diff --git a/src/option.c b/src/option.c -index e9598d6..382b01b 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -3557,6 +3557,11 @@ set_num_option( - errmsg = e_positive; - curbuf->b_p_ts = 8; - } -+ else if (curbuf->b_p_ts > TABSTOP_MAX) -+ { -+ errmsg = e_invalid_argument; -+ curbuf->b_p_ts = 8; -+ } - if (p_tm < 0) - { - errmsg = e_positive; -@@ -5758,7 +5763,7 @@ buf_copy_options(buf_T *buf, int flags) - if (p_vsts && p_vsts != empty_option) - (void)tabstop_set(p_vsts, &buf->b_p_vsts_array); - else -- buf->b_p_vsts_array = 0; -+ buf->b_p_vsts_array = NULL; - buf->b_p_vsts_nopaste = p_vsts_nopaste - ? vim_strsave(p_vsts_nopaste) : NULL; - #endif -@@ -6583,9 +6588,7 @@ paste_option_changed(void) - if (buf->b_p_vsts) - free_string_option(buf->b_p_vsts); - buf->b_p_vsts = empty_option; -- if (buf->b_p_vsts_array) -- vim_free(buf->b_p_vsts_array); -- buf->b_p_vsts_array = 0; -+ VIM_CLEAR(buf->b_p_vsts_array); - #endif - } - -@@ -6631,12 +6634,11 @@ paste_option_changed(void) - free_string_option(buf->b_p_vsts); - buf->b_p_vsts = buf->b_p_vsts_nopaste - ? vim_strsave(buf->b_p_vsts_nopaste) : empty_option; -- if (buf->b_p_vsts_array) -- vim_free(buf->b_p_vsts_array); -+ vim_free(buf->b_p_vsts_array); - if (buf->b_p_vsts && buf->b_p_vsts != empty_option) - (void)tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array); - else -- buf->b_p_vsts_array = 0; -+ buf->b_p_vsts_array = NULL; - #endif - } - -diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim -index 65600ee..d4213c1 100644 ---- a/src/testdir/test_options.vim -+++ b/src/testdir/test_options.vim -@@ -263,6 +263,8 @@ func Test_set_errors() - call assert_fails('set shiftwidth=-1', 'E487:') - call assert_fails('set sidescroll=-1', 'E487:') - call assert_fails('set tabstop=-1', 'E487:') -+ call assert_fails('set tabstop=10000', 'E474:') -+ call assert_fails('set tabstop=5500000000', 'E474:') - call assert_fails('set textwidth=-1', 'E487:') - call assert_fails('set timeoutlen=-1', 'E487:') - call assert_fails('set updatecount=-1', 'E487:') -diff --git a/src/vim.h b/src/vim.h -index 68e2de1..cd917a3 100644 ---- a/src/vim.h -+++ b/src/vim.h -@@ -2031,6 +2031,8 @@ typedef int sock_T; - - #define DICT_MAXNEST 100 // maximum nesting of lists and dicts - -+#define TABSTOP_MAX 9999 -+ - #ifdef FEAT_CLIPBOARD - - // VIM_ATOM_NAME is the older Vim-specific selection type for X11. Still --- -2.27.0 - diff --git a/backport-CVE-2022-0443.patch b/backport-CVE-2022-0443.patch deleted file mode 100644 index c2f351fa1b94d5d8d555aaa87d22ca1d63c28e48..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0443.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 9b4a80a66544f2782040b641498754bcb5b8d461 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 1 Feb 2022 13:54:17 +0000 -Subject: [PATCH] patch 8.2.4281: using freed memory with :lopen and :bwipe - -Problem: Using freed memory with :lopen and :bwipe. -Solution: Do not use a wiped out buffer. ---- - src/buffer.c | 14 ++++++++++---- - src/testdir/test_quickfix.vim | 16 ++++++++++++++++ - 2 files changed, 26 insertions(+), 4 deletions(-) - -diff --git a/src/buffer.c b/src/buffer.c -index b4992dd..0f4957d 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -1666,6 +1666,7 @@ set_curbuf(buf_T *buf, int action) - #endif - bufref_T newbufref; - bufref_T prevbufref; -+ int valid; - - setpcmark(); - if (!cmdmod.keepalt) -@@ -1717,13 +1718,19 @@ set_curbuf(buf_T *buf, int action) - // An autocommand may have deleted "buf", already entered it (e.g., when - // it did ":bunload") or aborted the script processing. - // If curwin->w_buffer is null, enter_buffer() will make it valid again -- if ((buf_valid(buf) && buf != curbuf -+ valid = buf_valid(buf); -+ if ((valid && buf != curbuf - #ifdef FEAT_EVAL - && !aborting() - #endif - ) || curwin->w_buffer == NULL) - { -- enter_buffer(buf); -+ // If the buffer is not valid but curwin->w_buffer is NULL we must -+ // enter some buffer. Using the last one is hopefully OK. -+ if (!valid) -+ enter_buffer(lastbuf); -+ else -+ enter_buffer(buf); - #ifdef FEAT_SYN_HL - if (old_tw != curbuf->b_p_tw) - check_colorcolumn(curwin); -@@ -2236,8 +2243,7 @@ free_buf_options( - clear_string_option(&buf->b_p_vsts); - vim_free(buf->b_p_vsts_nopaste); - buf->b_p_vsts_nopaste = NULL; -- vim_free(buf->b_p_vsts_array); -- buf->b_p_vsts_array = NULL; -+ VIM_CLEAR(buf->b_p_vsts_array); - clear_string_option(&buf->b_p_vts); - VIM_CLEAR(buf->b_p_vts_array); - #endif -diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim -index f7c73f4..38a5236 100644 ---- a/src/testdir/test_quickfix.vim -+++ b/src/testdir/test_quickfix.vim -@@ -876,6 +876,7 @@ func Test_locationlist_curwin_was_closed() - call assert_fails('lrewind', 'E924:') - - augroup! testgroup -+ delfunc R - endfunc - - func Test_locationlist_cross_tab_jump() -@@ -4674,4 +4675,19 @@ func Test_search_in_dirstack() - call delete('Xtestdir', 'rf') - endfunc - -+" Weird sequence of commands that caused entering a wiped-out buffer -+func Test_lopen_bwipe() -+ func R() -+ silent! tab lopen -+ e x -+ silent! lfile -+ endfunc -+ -+ cal R() -+ cal R() -+ cal R() -+ bw! -+ delfunc R -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-0554.patch b/backport-CVE-2022-0554.patch deleted file mode 100644 index c1860e7c4c87bfa51ca6ab5780b60d8c84c4832f..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0554.patch +++ /dev/null @@ -1,113 +0,0 @@ -From e3537aec2f8d6470010547af28dcbd83d41461b8 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 8 Feb 2022 15:05:20 +0000 -Subject: [PATCH] patch 8.2.4327: may end up with no current buffer - -Problem: May end up with no current buffer. -Solution: When deleting the current buffer to not pick a quickfix buffer as - the new current buffer - -Reference:https://github.com/vim/vim/commit/e3537aec2f8d6470010547af28dcbd83d41461b8 -Conflict:NA ---- - src/buffer.c | 26 ++++++++++++++++++++++---- - src/testdir/test_quickfix.vim | 25 +++++++++++++++++++++++++ - 2 files changed, 47 insertions(+), 4 deletions(-) - -diff --git a/src/buffer.c b/src/buffer.c -index e5f6a9b..3617c63 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -1520,8 +1520,14 @@ do_buffer( - buf = buflist_findnr(curwin->w_jumplist[jumpidx].fmark.fnum); - if (buf != NULL) - { -- if (buf == curbuf || !buf->b_p_bl) -- buf = NULL; // skip current and unlisted bufs -+ // Skip current and unlisted bufs. Also skip a quickfix -+ // buffer, it might be deleted soon. -+ if (buf == curbuf || !buf->b_p_bl -+#if defined(FEAT_QUICKFIX) -+ || bt_quickfix(buf) -+#endif -+ ) -+ buf = NULL; - else if (buf->b_ml.ml_mfp == NULL) - { - // skip unloaded buf, but may keep it for later -@@ -1558,7 +1564,11 @@ do_buffer( - continue; - } - // in non-help buffer, try to skip help buffers, and vv -- if (buf->b_help == curbuf->b_help && buf->b_p_bl) -+ if (buf->b_help == curbuf->b_help && buf->b_p_bl -+#if defined(FEAT_QUICKFIX) -+ && !bt_quickfix(buf) -+#endif -+ ) - { - if (buf->b_ml.ml_mfp != NULL) // found loaded buffer - break; -@@ -1576,7 +1586,11 @@ do_buffer( - if (buf == NULL) // No loaded buffer, find listed one - { - FOR_ALL_BUFFERS(buf) -- if (buf->b_p_bl && buf != curbuf) -+ if (buf->b_p_bl && buf != curbuf -+#if defined(FEAT_QUICKFIX) -+ && !bt_quickfix(buf) -+#endif -+ ) - break; - } - if (buf == NULL) // Still no buffer, just take one -@@ -1585,6 +1599,10 @@ do_buffer( - buf = curbuf->b_next; - else - buf = curbuf->b_prev; -+#if defined(FEAT_QUICKFIX) -+ if (bt_quickfix(buf)) -+ buf = NULL; -+#endif - } - } - -diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim -index 38a5236..72f3172 100644 ---- a/src/testdir/test_quickfix.vim -+++ b/src/testdir/test_quickfix.vim -@@ -325,6 +325,31 @@ func Test_copenHeight_tabline() - set tabline& showtabline& - endfunc - -+" Another sequence of commands that caused all buffers to be wiped out -+func Test_lopen_bwipe_all() -+ let lines =<< trim END -+ func R() -+ silent! tab lopen -+ e foo -+ silent! lfile -+ endfunc -+ cal R() -+ exe "norm \\0" -+ cal R() -+ bwipe -+ -+ call writefile(['done'], 'Xresult') -+ qall! -+ END -+ call writefile(lines, 'Xscript') -+ if RunVim([], [], '-u NONE -n -X -Z -e -m -s -S Xscript') -+ call assert_equal(['done'], readfile('Xresult')) -+ endif -+ -+ call delete('Xscript') -+ call delete('Xresult') -+endfunc -+ - - " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile - " commands. --- -2.27.0 - diff --git a/backport-CVE-2022-0572.patch b/backport-CVE-2022-0572.patch deleted file mode 100644 index 429ba09b23d8a9aa3a08a3990459e68ebedf5081..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0572.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 6e28703a8e41f775f64e442c5d11ce1ff599aa3f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 12 Feb 2022 15:42:18 +0000 -Subject: [PATCH] patch 8.2.4359: crash when repeatedly using :retab - -Problem: crash when repeatedly using :retab. -Solution: Bail out when the line is getting too long. ---- - src/indent.c | 5 +++++ - src/testdir/test_retab.vim | 20 ++++++++++++++++++++ - 2 files changed, 25 insertions(+) - -diff --git a/src/indent.c b/src/indent.c -index e8e93b9..075802c 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -1689,6 +1689,11 @@ ex_retab(exarg_T *eap) - if (ptr[col] == NUL) - break; - vcol += chartabsize(ptr + col, (colnr_T)vcol); -+ if (vcol >= MAXCOL) -+ { -+ emsg(_(e_resulting_text_too_long)); -+ break; -+ } - if (has_mbyte) - col += (*mb_ptr2len)(ptr + col); - else -diff --git a/src/testdir/test_retab.vim b/src/testdir/test_retab.vim -index e7b8946..5376f92 100644 ---- a/src/testdir/test_retab.vim -+++ b/src/testdir/test_retab.vim -@@ -69,6 +69,8 @@ func Test_retab() - call assert_equal(" a b c ", Retab('!', 3)) - call assert_equal(" a b c ", Retab('', 5)) - call assert_equal(" a b c ", Retab('!', 5)) -+ -+ set tabstop& expandtab& - endfunc - - func Test_retab_error() -@@ -78,3 +80,21 @@ func Test_retab_error() - call assert_fails('ret 10000', 'E475:') - call assert_fails('ret 80000000000000000000', 'E475:') - endfunc -+ -+func Test_retab_endless() -+ new -+ call setline(1, "\t0\t") -+ let caught = 'no' -+ try -+ while 1 -+ set ts=4000 -+ retab 4 -+ endwhile -+ catch /E1240/ -+ let caught = 'yes' -+ endtry -+ bwipe! -+ set tabstop& -+endfunc -+ -+" vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-0629.patch b/backport-CVE-2022-0629.patch deleted file mode 100644 index 9071a2bada1359013f358570d3ba1d2b6b618e90..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0629.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 34f8117dec685ace52cd9e578e2729db278163fc Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 16 Feb 2022 12:16:19 +0000 -Subject: [PATCH] patch 8.2.4397: crash when using many composing characters in - error message - -Problem: Crash when using many composing characters in error message. -Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv(). ---- - src/testdir/test_assert.vim | 8 ++++++++ - src/testing.c | 2 +- - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim -index 1b1f9e5..1e7d66f 100644 ---- a/src/testdir/test_assert.vim -+++ b/src/testdir/test_assert.vim -@@ -45,6 +45,14 @@ func Test_assert_equal() - call assert_equal('XxxxxxxxxxxxxxxxxxxxxxX', 'XyyyyyyyyyyyyyyyyyyyyyyyyyX') - call assert_match("Expected 'X\\\\\\[x occurs 21 times]X' but got 'X\\\\\\[y occurs 25 times]X'", v:errors[0]) - call remove(v:errors, 0) -+ -+ " many composing characters are handled properly -+ call setline(1, ' ') -+ norm 100grÝ€ -+ call assert_equal(1, getline(1)) -+ call assert_match("Expected 1 but got '.* occurs 100 times]'", v:errors[0]) -+ call remove(v:errors, 0) -+ bwipe! - endfunc - - func Test_assert_equalfile() -diff --git a/src/testing.c b/src/testing.c -index f879f1e..f19481f 100644 ---- a/src/testing.c -+++ b/src/testing.c -@@ -99,7 +99,7 @@ ga_concat_shorten_esc(garray_T *gap, char_u *str) - { - same_len = 1; - s = p; -- c = mb_ptr2char_adv(&s); -+ c = mb_cptr2char_adv(&s); - clen = s - p; - while (*s != NUL && c == mb_ptr2char(s)) - { --- -2.27.0 - diff --git a/backport-CVE-2022-0685.patch b/backport-CVE-2022-0685.patch deleted file mode 100644 index e8203a5a335e1b6952ac7af1930bff7f8435e28b..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0685.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 5921aeb5741fc6e84c870d68c7c35b93ad0c9f87 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 19 Feb 2022 11:20:12 +0000 -Subject: [PATCH] patch 8.2.4418: crash when using special multi-byte character - -Problem: Crash when using special multi-byte character. -Solution: Don't use isalpha() for an arbitrary character. - -Conflict: -upstream patches: -+ call assert_fails('tc űŤŤŤ¦*', 'E344:') -openEuler patches: -+ call assert_fails('tc űŤŤŤ¦*', 'E472:') ---- - src/charset.c | 6 ++++++ - src/filepath.c | 2 +- - src/proto/charset.pro | 2 +- - src/testdir/test_autochdir.vim | 7 +++++++ - 4 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/src/charset.c b/src/charset.c -index a768c17..847a01a 100644 ---- a/src/charset.c -+++ b/src/charset.c -@@ -1654,6 +1654,12 @@ vim_isupper(int c) - return isupper(c); - } - -+ int -+vim_isalpha(int c) -+{ -+ return vim_islower(c) || vim_isupper(c); -+} -+ - int - vim_toupper(int c) - { -diff --git a/src/filepath.c b/src/filepath.c -index 01d2dcb..c7f0265 100644 ---- a/src/filepath.c -+++ b/src/filepath.c -@@ -3300,7 +3300,7 @@ unix_expandpath( - else if (path_end >= path + wildoff - && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL - || (!p_fic && (flags & EW_ICASE) -- && isalpha(PTR2CHAR(path_end))))) -+ && vim_isalpha(PTR2CHAR(path_end))))) - e = p; - if (has_mbyte) - { -diff --git a/src/proto/charset.pro b/src/proto/charset.pro -index c582a8c..2a928e3 100644 ---- a/src/proto/charset.pro -+++ b/src/proto/charset.pro -@@ -47,6 +47,7 @@ int vim_isxdigit(int c); - int vim_isbdigit(int c); - int vim_islower(int c); - int vim_isupper(int c); -+int vim_isalpha(int c); - int vim_toupper(int c); - int vim_tolower(int c); - char_u *skiptowhite(char_u *p); -@@ -59,5 +60,4 @@ int hexhex2nr(char_u *p); - int rem_backslash(char_u *str); - void backslash_halve(char_u *p); - char_u *backslash_halve_save(char_u *p); --void ebcdic2ascii(char_u *buffer, int len); - /* vim: set ft=c : */ -diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim -index 1473854..99fc9ae 100644 ---- a/src/testdir/test_autochdir.vim -+++ b/src/testdir/test_autochdir.vim -@@ -24,3 +24,10 @@ func Test_set_filename() - call chdir(cwd) - call delete('samples/Xtest') - endfunc -+ -+func Test_multibyte() -+ " using an invalid character should not cause a crash -+ set wic -+ call assert_fails('tc űŤŤŤ¦*', 'E472:') -+ set nowic -+endfunc --- -2.27.0 diff --git a/backport-CVE-2022-0714.patch b/backport-CVE-2022-0714.patch deleted file mode 100644 index e73192a37683fe86c9d6c74a85f35e05964b61a0..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0714.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4e889f98e95ac05d7c8bd3ee933ab4d47820fdfa Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 21 Feb 2022 19:36:12 +0000 -Subject: [PATCH] patch 8.2.4436: crash with weird 'vartabstop' value - -Problem: Crash with weird 'vartabstop' value. -Solution: Check for running into the end of the line. - ---- - src/indent.c | 2 ++ - src/testdir/test_vartabs.vim | 14 ++++++++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/src/indent.c b/src/indent.c -index 075802c..6b8900f 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -1279,6 +1279,8 @@ change_indent( - new_cursor_col += (*mb_ptr2len)(ptr + new_cursor_col); - else - ++new_cursor_col; -+ if (ptr[new_cursor_col] == NUL) -+ break; - vcol += lbr_chartabsize(ptr, ptr + new_cursor_col, (colnr_T)vcol); - } - vcol = last_vcol; -diff --git a/src/testdir/test_vartabs.vim b/src/testdir/test_vartabs.vim -index 47844fb..c2919d8 100644 ---- a/src/testdir/test_vartabs.vim -+++ b/src/testdir/test_vartabs.vim -@@ -378,3 +378,17 @@ func Test_vartabs_reset() - set all& - call assert_equal('', &vts) - endfunc -+ -+func Test_vartabstop_latin1() -+ let save_encoding = &encoding -+ new -+ set encoding=iso8859 -+ silent norm :se  -+ set vartabstop=400 -+ norm i00  -+ bwipe! -+ let &encoding = save_encoding -+endfunc -+ -+ -+" vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-0729.patch b/backport-CVE-2022-0729.patch deleted file mode 100644 index fb2ec58e901661647f3ac67d2b89ed64877af966..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0729.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6456fae9ba8e72c74b2c0c499eaf09974604ff30 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 22 Feb 2022 13:37:31 +0000 -Subject: [PATCH] patch 8.2.4440: crash with specific regexp pattern and string - -Problem: Crash with specific regexp pattern and string. -Solution: Stop at the start of the string. - ---- - src/regexp_bt.c | 5 +++++ - src/testdir/test_regexp_utf8.vim | 7 +++++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/regexp_bt.c b/src/regexp_bt.c -index b71b862..e017ba5 100644 ---- a/src/regexp_bt.c -+++ b/src/regexp_bt.c -@@ -4431,6 +4431,11 @@ regmatch( - if (rex.input == rex.line) - { - // backup to last char of previous line -+ if (rex.lnum == 0) -+ { -+ status = RA_NOMATCH; -+ break; -+ } - --rex.lnum; - rex.line = reg_getline(rex.lnum); - // Just in case regrepeat() didn't count -diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim -index 6d0ce59..5d1bd47 100644 ---- a/src/testdir/test_regexp_utf8.vim -+++ b/src/testdir/test_regexp_utf8.vim -@@ -223,3 +223,10 @@ func Test_match_invalid_byte() - call delete('Xinvalid') - endfunc - -+func Test_match_too_complicated() -+ set regexpengine=1 -+ exe "vsplit \xeb\xdb\x99" -+ silent! buf \&\zs*\zs*0 -+ bwipe! -+ set regexpengine=0 -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2022-0943.patch b/backport-CVE-2022-0943.patch deleted file mode 100644 index 96341bb7e5b3079c8c35772c1601443302511be1..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-0943.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 5c68617d395f9d7b824f68475b24ce3e38d653a3 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 13 Mar 2022 20:12:25 +0000 -Subject: [PATCH] patch 8.2.4563: "z=" in Visual mode may go beyond the end of - the line - -Problem: "z=" in Visual mode may go beyond the end of the line. -Solution: Adjust "badlen". ---- - src/spellsuggest.c | 4 ++++ - src/testdir/test_spell.vim | 15 +++++++++++++++ - 2 files changed, 19 insertions(+) - -diff --git a/src/spellsuggest.c b/src/spellsuggest.c -index cd28798..429e292 100644 ---- a/src/spellsuggest.c -+++ b/src/spellsuggest.c -@@ -501,6 +501,10 @@ spell_suggest(int count) - curwin->w_cursor.col = VIsual.col; - ++badlen; - end_visual_mode(); -+ // make sure we don't include the NUL at the end of the line -+ line = ml_get_curline(); -+ if (badlen > STRLEN(line) - curwin->w_cursor.col) -+ badlen = STRLEN(line) - curwin->w_cursor.col; - } - // Find the start of the badly spelled word. - else if (spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL) == 0 -diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index de49b42..49118a9 100644 ---- a/src/testdir/test_spell.vim -+++ b/src/testdir/test_spell.vim -@@ -131,6 +131,21 @@ func Test_spellreall() - bwipe! - endfunc - -+func Test_spellsuggest_visual_end_of_line() -+ let enc_save = &encoding -+ set encoding=iso8859 -+ -+ " This was reading beyond the end of the line. -+ norm R00000000000 -+ sil norm 0 -+ sil! norm i00000) -+ sil! norm i00000) -+ call feedkeys("\") -+ norm z= -+ -+ let &encoding = enc_save -+endfunc -+ - func Test_spellinfo() - new - let runtime = substitute($VIMRUNTIME, '\\', '/', 'g') --- -2.27.0 - diff --git a/backport-CVE-2022-1154.patch b/backport-CVE-2022-1154.patch deleted file mode 100644 index e4d10c8fedddd33466c839c44a1b7e6c63eb9a5f..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1154.patch +++ /dev/null @@ -1,59 +0,0 @@ -From b55986c52d4cd88a22d0b0b0e8a79547ba13e1d5 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 29 Mar 2022 13:24:58 +0100 -Subject: [PATCH] patch 8.2.4646: using buffer line after it has been freed - -Problem: Using buffer line after it has been freed in old regexp engine. -Solution: After getting mark get the line again. ---- - src/regexp_bt.c | 9 +++++++++ - src/testdir/test_regexp_latin.vim | 7 +++++++ - 2 files changed, 16 insertions(+) - -diff --git a/src/regexp_bt.c b/src/regexp_bt.c -index e017ba5..ff92576 100644 ---- a/src/regexp_bt.c -+++ b/src/regexp_bt.c -@@ -3188,8 +3188,17 @@ regmatch( - int mark = OPERAND(scan)[0]; - int cmp = OPERAND(scan)[1]; - pos_T *pos; -+ size_t col = REG_MULTI ? rex.input - rex.line : 0; - - pos = getmark_buf(rex.reg_buf, mark, FALSE); -+ -+ // Line may have been freed, get it again. -+ if (REG_MULTI) -+ { -+ rex.line = reg_getline(rex.lnum); -+ rex.input = rex.line + col; -+ } -+ - if (pos == NULL // mark doesn't exist - || pos->lnum <= 0 // mark isn't set in reg_buf - || (pos->lnum == rex.lnum + rex.reg_firstlnum -diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim -index 5b1db5a..a242d91 100644 ---- a/src/testdir/test_regexp_latin.vim -+++ b/src/testdir/test_regexp_latin.vim -@@ -152,10 +152,17 @@ endfunc - - func Test_using_mark_position() - " this was using freed memory -+ " new engine - new - norm O0 - call assert_fails("s/\\%')", 'E486:') - bwipe! -+ -+ " old engine -+ new -+ norm O0 -+ call assert_fails("s/\\%#=1\\%')", 'E486:') -+ bwipe! - endfunc - - func Test_using_invalid_visual_position() --- -1.8.3.1 - diff --git a/backport-CVE-2022-1616.patch b/backport-CVE-2022-1616.patch deleted file mode 100644 index 4751e75bf85494db1061e29540e60d3dc214ace0..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1616.patch +++ /dev/null @@ -1,58 +0,0 @@ -From d88934406c5375d88f8f1b65331c9f0cab68cc6c Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 6 May 2022 20:38:47 +0100 -Subject: [PATCH] patch 8.2.4895: buffer overflow with invalid command with - composing chars - -Problem: Buffer overflow with invalid command with composing chars. -Solution: Check that the whole character fits in the buffer. ---- - src/ex_docmd.c | 4 +++- - src/testdir/test_cmdline.vim | 11 +++++++++++ - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index dfcbf37..f142c46 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -3092,7 +3092,7 @@ append_command(char_u *cmd) - - STRCAT(IObuff, ": "); - d = IObuff + STRLEN(IObuff); -- while (*s != NUL && d - IObuff < IOSIZE - 7) -+ while (*s != NUL && d - IObuff + 5 < IOSIZE) - { - if (enc_utf8 ? (s[0] == 0xc2 && s[1] == 0xa0) : *s == 0xa0) - { -@@ -3100,6 +3100,8 @@ append_command(char_u *cmd) - STRCPY(d, ""); - d += 4; - } -+ else if (d - IObuff + (*mb_ptr2len)(s) + 1 >= IOSIZE) -+ break; - else - MB_COPY_CHAR(s, d); - } -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 5297951..41a73d2 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -870,4 +870,15 @@ func Test_cmdwin_cedit() - delfunc CmdWinType - endfunc - -+" this was going over the end of IObuff -+func Test_report_error_with_composing() -+ let caught = 'no' -+ try -+ exe repeat('0', 987) .. "0\xdd\x80\xdd\x80\xdd\x80\xdd\x80" -+ catch /E492:/ -+ let caught = 'yes' -+ endtry -+ call assert_equal('yes', caught) -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-1619.patch b/backport-CVE-2022-1619.patch deleted file mode 100644 index 1e6eebff7383a5b9416c7a527574139d6c830805..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1619.patch +++ /dev/null @@ -1,53 +0,0 @@ -From ef02f16609ff0a26ffc6e20263523424980898fe Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 7 May 2022 10:49:10 +0100 -Subject: [PATCH] patch 8.2.4899: with latin1 encoding CTRL-W might go before - the cmdline - -Problem: With latin1 encoding CTRL-W might go before the start of the -command line. -Solution: Check already being at the start of the command line. ---- - src/ex_getln.c | 11 +++++++---- - src/testdir/test_cmdline.vim | 3 +++ - 2 files changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 68b4757..771a9cd 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -1583,10 +1583,13 @@ getcmdline_int( - { - while (p > ccline.cmdbuff && vim_isspace(p[-1])) - --p; -- i = vim_iswordc(p[-1]); -- while (p > ccline.cmdbuff && !vim_isspace(p[-1]) -- && vim_iswordc(p[-1]) == i) -- --p; -+ if (p > ccline.cmdbuff) -+ { -+ i = vim_iswordc(p[-1]); -+ while (p > ccline.cmdbuff && !vim_isspace(p[-1]) -+ && vim_iswordc(p[-1]) == i) -+ --p; -+ } - } - else - --p; -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index cbf7986..1ccdbe2 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -476,6 +476,9 @@ func Test_cmdline_remove_char() - - call feedkeys(":abc def\\\\"\", 'tx') - call assert_equal('"def', @:, e) -+ -+ " This was going before the start in latin1. -+ call feedkeys(": \\", 'tx') - endfor - - let &encoding = encoding_save --- -1.8.3.1 - diff --git a/backport-CVE-2022-1620.patch b/backport-CVE-2022-1620.patch deleted file mode 100644 index 99ec950236d7b1866900737e533147e5022064a7..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1620.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8e4b76da1d7e987d43ca960dfbc372d1c617466f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 7 May 2022 11:28:06 +0100 -Subject: [PATCH] patch 8.2.4901: NULL pointer access when using invalid - pattern - -Problem: NULL pointer access when using invalid pattern. -Solution: Check for failed regexp program. ---- - src/buffer.c | 2 +- - src/testdir/test_buffer.vim | 7 +++++++ - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/buffer.c b/src/buffer.c -index 5801bce..758d920 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -2830,7 +2830,7 @@ fname_match( - rmp->rm_ic = p_fic || ignore_case; - if (vim_regexec(rmp, name, (colnr_T)0)) - match = name; -- else -+ else if (rmp->regprog != NULL) - { - // Replace $(HOME) with '~' and try matching again. - p = home_replace_save(NULL, name); -diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim -index dc35bb4..8300f3d 100644 ---- a/src/testdir/test_buffer.vim -+++ b/src/testdir/test_buffer.vim -@@ -63,4 +63,11 @@ func Test_bunload_with_offset() - call delete('b4') - endfunc - -+" this was using a NULL pointer after failing to use the pattern -+func Test_buf_pattern_invalid() -+ vsplit 0000000 -+ silent! buf [0--]\&\zs*\zs*e -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-1621.patch b/backport-CVE-2022-1621.patch deleted file mode 100644 index 1be3b02cde97552efec434e066ebdf7b58910cf8..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1621.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 7c824682d2028432ee082703ef0ab399867a089b Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 8 May 2022 22:32:58 +0100 -Subject: [PATCH] patch 8.2.4919: can add invalid bytes with :spellgood - -Problem: Can add invalid bytes with :spellgood. -Solution: Check for a valid word string. ---- - src/globals.h | 5 +++++ - src/mbyte.c | 2 +- - src/spellfile.c | 10 ++++++++++ - src/testdir/test_spellfile.vim | 6 ++++++ - 4 files changed, 22 insertions(+), 1 deletion(-) - -diff --git a/src/globals.h b/src/globals.h -index 7be3bfd..086d04e 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1745,3 +1745,8 @@ EXTERN int did_repeated_msg INIT(= 0); - # define REPEATED_MSG_LOOKING 1 - # define REPEATED_MSG_SAFESTATE 2 - #endif -+ -+#ifdef FEAT_SPELL -+EXTERN char e_illegal_character_in_word[] -+ INIT(= N_("E1280: Illegal character in word")); -+#endif -diff --git a/src/mbyte.c b/src/mbyte.c -index 5dd2562..28c5e85 100644 ---- a/src/mbyte.c -+++ b/src/mbyte.c -@@ -4045,7 +4045,7 @@ theend: - convert_setup(&vimconv, NULL, NULL); - } - --#if defined(FEAT_GUI_GTK) || defined(PROTO) -+#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO) - /* - * Return TRUE if string "s" is a valid utf-8 string. - * When "end" is NULL stop at the first NUL. -diff --git a/src/spellfile.c b/src/spellfile.c -index b9451ec..5171572 100644 ---- a/src/spellfile.c -+++ b/src/spellfile.c -@@ -4366,6 +4366,10 @@ store_word( - int res = OK; - char_u *p; - -+ // Avoid adding illegal bytes to the word tree. -+ if (enc_utf8 && !utf_valid_string(word, NULL)) -+ return FAIL; -+ - (void)spell_casefold(word, len, foldword, MAXWLEN); - for (p = pfxlist; res == OK; ++p) - { -@@ -6167,6 +6171,12 @@ spell_add_word( - int i; - char_u *spf; - -+ if (enc_utf8 && !utf_valid_string(word, NULL)) -+ { -+ emsg(_(e_illegal_character_in_word)); -+ return; -+ } -+ - if (idx == 0) // use internal wordlist - { - if (int_wordlist == NULL) -diff --git a/src/testdir/test_spellfile.vim b/src/testdir/test_spellfile.vim -index 53eca84..1382c02 100644 ---- a/src/testdir/test_spellfile.vim -+++ b/src/testdir/test_spellfile.vim -@@ -170,3 +170,9 @@ func Test_spell_normal() - set spellfile= - bw! - endfunc -+ -+" Invalid bytes may cause trouble when creating the word list. -+func Test_check_for_valid_word() -+ call assert_fails("spellgood! 0^B\xac", 'E1280:') -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2022-1629.patch b/backport-CVE-2022-1629.patch deleted file mode 100644 index 37e2ea1f5f8c592d792e8486ce5c591c39ee8a9a..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1629.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 53a70289c2712808e6d4e88927e03cac01b470dd Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 9 May 2022 13:15:07 +0100 -Subject: [PATCH] patch 8.2.4925: trailing backslash may cause reading past end - of line - -Problem: Trailing backslash may cause reading past end of line. -Solution: Check for NUL after backslash. ---- - src/search.c | 4 ++++ - src/testdir/test_textobjects.vim | 10 +++++++++- - 2 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/src/search.c b/src/search.c -index 1a5dc1a..75f0c59 100644 ---- a/src/search.c -+++ b/src/search.c -@@ -4457,7 +4457,11 @@ find_next_quote( - if (c == NUL) - return -1; - else if (escape != NULL && vim_strchr(escape, c)) -+ { - ++col; -+ if (line[col] == NUL) -+ return -1; -+ } - else if (c == quotechar) - break; - if (has_mbyte) -diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim -index 49fc9c8..3fc0283 100644 ---- a/src/testdir/test_textobjects.vim -+++ b/src/testdir/test_textobjects.vim -@@ -154,10 +154,18 @@ func Test_string_html_objects() - call assert_equal('-', getline('.'), e) - - set quoteescape& -+ -+ " this was going beyond the end of the line -+ %del -+ sil! norm i"\ -+ sil! norm i"\ -+ sil! norm i"\ -+ call assert_equal('"\', getline(1)) -+ -+ bwipe! - endfor - - set enc=utf-8 -- bwipe! - endfunc - - func Test_empty_html_tag() --- -1.8.3.1 - diff --git a/backport-CVE-2022-1674.patch b/backport-CVE-2022-1674.patch deleted file mode 100644 index 42335e045ea59b01ae40e821a5eb102692d879f1..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1674.patch +++ /dev/null @@ -1,44 +0,0 @@ -From a59f2dfd0cf9ee1a584d3de5b7c2d47648e79060 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 11 May 2022 11:42:28 +0100 -Subject: [PATCH] patch 8.2.4938: crash when matching buffer with invalid - pattern - -Problem: Crash when matching buffer with invalid pattern. -Solution: Check for NULL regprog. ---- - src/buffer.c | 2 +- - src/testdir/test_buffer.vim | 4 ++++ - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/buffer.c b/src/buffer.c -index 758d920..88094ee 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -2805,7 +2805,7 @@ buflist_match( - - // First try the short file name, then the long file name. - match = fname_match(rmp, buf->b_sfname, ignore_case); -- if (match == NULL) -+ if (match == NULL && rmp->regprog != NULL) - match = fname_match(rmp, buf->b_ffname, ignore_case); - - return match; -diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim -index 8300f3d..6039ff8 100644 ---- a/src/testdir/test_buffer.vim -+++ b/src/testdir/test_buffer.vim -@@ -68,6 +68,10 @@ func Test_buf_pattern_invalid() - vsplit 0000000 - silent! buf [0--]\&\zs*\zs*e - bwipe! -+ -+ vsplit 00000000000000000000000000 -+ silent! buf [0--]\&\zs*\zs*e -+ bwipe! - endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-1720.patch b/backport-CVE-2022-1720.patch deleted file mode 100644 index 7a059119dfe39af3191772ad31cce23c5f1fc693..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1720.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 395bd1f6d3edc9f7edb5d1f2d7deaf5a9e3ab93c Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 14 May 2022 21:29:44 +0100 -Subject: [PATCH] patch 8.2.4956: reading past end of line with "gf" in Visual - block mode - -Problem: Reading past end of line with "gf" in Visual block mode. -Solution: Do not include the NUL in the length. ---- - src/normal.c | 13 ++++++++++--- - src/testdir/test_gf.vim | 15 +++++++++++++++ - 2 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/src/normal.c b/src/normal.c -index d33a56a..898c836 100644 ---- a/src/normal.c -+++ b/src/normal.c -@@ -3791,9 +3791,16 @@ get_visual_text( - } - if (**pp == NUL) - *lenp = 0; -- if (has_mbyte && *lenp > 0) -- // Correct the length to include all bytes of the last character. -- *lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1; -+ if (*lenp > 0) -+ { -+ if (has_mbyte) -+ // Correct the length to include all bytes of the last -+ // character. -+ *lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1; -+ else if ((*pp)[*lenp - 1] == NUL) -+ // Do not include a trailing NUL. -+ *lenp -= 1; -+ } - } - reset_VIsual_and_resel(); - return OK; -diff --git a/src/testdir/test_gf.vim b/src/testdir/test_gf.vim -index d301874..596f3e8 100644 ---- a/src/testdir/test_gf.vim -+++ b/src/testdir/test_gf.vim -@@ -106,6 +106,21 @@ func Test_gf_visual() - call setline(1, 'XXXtest_gf_visualXXX') - set hidden - -+ " do not include the NUL at the end -+ call writefile(['x'], 'X') -+ let save_enc = &enc -+ for enc in ['latin1', 'utf-8'] -+ exe "set enc=" .. enc -+ new -+ call setline(1, 'X') -+ set nomodified -+ exe "normal \$gf" -+ call assert_equal('X', bufname()) -+ bwipe! -+ endfor -+ let &enc = save_enc -+ call delete('X') -+ - " Visually select Xtest_gf_visual and use gf to go to that file - norm! ttvtXgf - call assert_equal('Xtest_gf_visual', bufname('%')) --- -1.8.3.1 - diff --git a/backport-CVE-2022-1725.patch b/backport-CVE-2022-1725.patch deleted file mode 100644 index 9c402344d037fff66393a4bfc55c2b7bd46972f5..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1725.patch +++ /dev/null @@ -1,119 +0,0 @@ -From b62dc5e7825bc195efe3041d5b3a9f1528359e1c Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 15 May 2022 14:50:12 +0100 -Subject: [PATCH] patch 8.2.4959: using NULL regexp program - -Problem: Using NULL regexp program. -Solution: Check for regexp program becoming NULL in more places. ---- - src/buffer.c | 32 +++++++++++++++++++------------- - src/testdir/test_buffer.vim | 6 ++++++ - 2 files changed, 25 insertions(+), 13 deletions(-) - -diff --git a/src/buffer.c b/src/buffer.c -index 8fabbdb..f66c234 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -2583,13 +2583,15 @@ buflist_findpat( - if (*p == '^' && !(attempt & 1)) // add/remove '^' - ++p; - regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0); -- if (regmatch.regprog == NULL) -- { -- vim_free(pat); -- return -1; -- } - - for (buf = lastbuf; buf != NULL; buf = buf->b_prev) -+ { -+ if (regmatch.regprog == NULL) -+ { -+ // invalid pattern, possibly after switching engine -+ vim_free(pat); -+ return -1; -+ } - if (buf->b_p_bl == find_listed - #ifdef FEAT_DIFF - && (!diffmode || diff_mode_buf(buf)) -@@ -2615,6 +2617,7 @@ buflist_findpat( - } - match = buf->b_fnum; // remember first match - } -+ } - - vim_regfree(regmatch.regprog); - if (match >= 0) // found one match -@@ -2693,12 +2696,6 @@ ExpandBufnames( - if (attempt > 0 && patc == pat) - break; // there was no anchor, no need to try again - regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC); -- if (regmatch.regprog == NULL) -- { -- if (patc != pat) -- vim_free(patc); -- return FAIL; -- } - - /* - * round == 1: Count the matches. -@@ -2711,6 +2708,12 @@ ExpandBufnames( - { - if (!buf->b_p_bl) // skip unlisted buffers - continue; -+ if (regmatch.regprog == NULL) -+ { -+ if (patc != pat) -+ vim_free(patc); -+ return FAIL; -+ } - p = buflist_match(®match, buf, p_wic); - if (p != NULL) - { -@@ -2789,6 +2792,7 @@ ExpandBufnames( - - /* - * Check for a match on the file name for buffer "buf" with regprog "prog". -+ * Note that rmp->regprog may become NULL when switching regexp engine. - */ - static char_u * - buflist_match( -@@ -2807,7 +2811,8 @@ buflist_match( - } - - /* -- * Try matching the regexp in "prog" with file name "name". -+ * Try matching the regexp in "rmp->regprog" with file name "name". -+ * Note that rmp->regprog may become NULL when switching regexp engine. - * Return "name" when there is a match, NULL when not. - */ - static char_u * -@@ -2819,7 +2824,8 @@ fname_match( - char_u *match = NULL; - char_u *p; - -- if (name != NULL) -+ // extra check for valid arguments -+ if (name != NULL && rmp->regprog != NULL) - { - // Ignore case when 'fileignorecase' or the argument is set. - rmp->rm_ic = p_fic || ignore_case; -diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim -index 6039ff8..cef0213 100644 ---- a/src/testdir/test_buffer.vim -+++ b/src/testdir/test_buffer.vim -@@ -72,6 +72,12 @@ func Test_buf_pattern_invalid() - vsplit 00000000000000000000000000 - silent! buf [0--]\&\zs*\zs*e - bwipe! -+ -+ " similar case with different code path -+ split 0 -+ edit ÿ -+ silent! buf [0--]\&\zs*\zs*0 -+ bwipe! - endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-1733.patch b/backport-CVE-2022-1733.patch deleted file mode 100644 index 499cdbf1c807d157f7bde843a3370e21c6c9d92c..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1733.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 60ae0e71490c97f2871a6344aca61cacf220f813 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 16 May 2022 18:06:15 +0100 -Subject: [PATCH] patch 8.2.4968: reading past end of the line when C-indenting - -Problem: Reading past end of the line when C-indenting. -Solution: Check for NUL. ---- - src/cindent.c | 2 +- - src/testdir/test_cindent.vim | 7 +++++++ - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/cindent.c b/src/cindent.c -index 28d1558..1b2763f 100644 ---- a/src/cindent.c -+++ b/src/cindent.c -@@ -91,7 +91,7 @@ skip_string(char_u *p) - while (vim_isdigit(p[i - 1])) // '\000' - ++i; - } -- if (p[i] == '\'') // check for trailing ' -+ if (p[i - 1] != NUL && p[i] == '\'') // check for trailing ' - { - p += i; - continue; -diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim -index 2a87460..3b2200a 100644 ---- a/src/testdir/test_cindent.vim -+++ b/src/testdir/test_cindent.vim -@@ -5263,4 +5263,11 @@ func Test_find_brace_backwards() - endfunc - - -+" This was reading past the end of the line -+func Test_cindent_check_funcdecl() -+ new -+ sil norm o0('\0=L -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-1735.patch b/backport-CVE-2022-1735.patch deleted file mode 100644 index 007f18ebfb6e04c0db52de61dda8023a876debda..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1735.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 16 May 2022 19:40:59 +0100 -Subject: [PATCH] patch 8.2.4969: changing text in Visual mode may cause - invalid memory access - -Problem: Changing text in Visual mode may cause invalid memory access. -Solution: Check the Visual position after making a change. ---- - src/change.c | 3 +++ - src/edit.c | 12 ++---------- - src/misc2.c | 25 +++++++++++++++++++++++++ - src/proto/misc2.pro | 1 + - src/testdir/test_visual.vim | 10 ++++++++++ - 5 files changed, 41 insertions(+), 10 deletions(-) - -diff --git a/src/change.c b/src/change.c -index f2dfc93..a5ebbdf 100644 ---- a/src/change.c -+++ b/src/change.c -@@ -523,6 +523,9 @@ changed_common( - #endif - } - -+ if (VIsual_active) -+ check_visual_pos(); -+ - FOR_ALL_TAB_WINDOWS(tp, wp) - { - if (wp->w_buffer == curbuf) -diff --git a/src/edit.c b/src/edit.c -index f77cc05..0dd6b93 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -3101,16 +3101,8 @@ stop_insert( - - // may have started Visual mode, adjust the position for - // deleted characters. -- if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) -- { -- int len = (int)STRLEN(ml_get_curline()); -- -- if (VIsual.col > len) -- { -- VIsual.col = len; -- VIsual.coladd = 0; -- } -- } -+ if (VIsual_active) -+ check_visual_pos(); - } - } - did_ai = FALSE; -diff --git a/src/misc2.c b/src/misc2.c -index 80731f0..51244da 100644 ---- a/src/misc2.c -+++ b/src/misc2.c -@@ -618,6 +618,31 @@ check_cursor(void) - check_cursor_col(); - } - -+/* -+ * Check if VIsual position is valid, correct it if not. -+ * Can be called when in Visual mode and a change has been made. -+ */ -+ void -+check_visual_pos(void) -+{ -+ if (VIsual.lnum > curbuf->b_ml.ml_line_count) -+ { -+ VIsual.lnum = curbuf->b_ml.ml_line_count; -+ VIsual.col = 0; -+ VIsual.coladd = 0; -+ } -+ else -+ { -+ int len = (int)STRLEN(ml_get(VIsual.lnum)); -+ -+ if (VIsual.col > len) -+ { -+ VIsual.col = len; -+ VIsual.coladd = 0; -+ } -+ } -+} -+ - #if defined(FEAT_TEXTOBJ) || defined(PROTO) - /* - * Make sure curwin->w_cursor is not on the NUL at the end of the line. -diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro -index a52b462..6e6e22d 100644 ---- a/src/proto/misc2.pro -+++ b/src/proto/misc2.pro -@@ -17,6 +17,7 @@ void check_cursor_lnum(void); - void check_cursor_col(void); - void check_cursor_col_win(win_T *win); - void check_cursor(void); -+void check_visual_pos(void); - void adjust_cursor_col(void); - int leftcol_changed(void); - void vim_mem_profile_dump(void); -diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 4f8f056..d21f8f1 100644 ---- a/src/testdir/test_visual.vim -+++ b/src/testdir/test_visual.vim -@@ -956,3 +956,13 @@ func Test_visual_block_insert_round_off() - bwipe! - endfunc - -+func Test_visual_block_with_substitute() -+ " this was reading beyond the end of the line -+ new -+ norm a0) -+ sil! norm  O -+ s/) -+ sil! norm  -+ bwipe! -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2022-1771.patch b/backport-CVE-2022-1771.patch deleted file mode 100644 index 6d506bab45fe6dec409304dcbb07a5cbed3a87ab..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1771.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 51f0bfb88a3554ca2dde777d78a59880d1ee37a8 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 17 May 2022 20:11:02 +0100 -Subject: [PATCH] patch 8.2.4975: recursive command line loop may cause a crash - -Problem: Recursive command line loop may cause a crash. -Solution: Limit recursion of getcmdline(). - -Reference:https://github.com/vim/vim/commit/51f0bfb88a3554ca2dde777d78a59880d1ee37a8 -Conflict:(1)The src/version.c file is not modified -(2)add e_command_too_recursive in src/globals.h ---- - src/ex_getln.c | 12 ++++++++++++ - src/globals.h | 3 +++ - src/testdir/test_cmdline.vim | 11 +++++++++++ - 3 files changed, 26 insertions(+) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 7571ae2..aa01f80 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -791,6 +791,7 @@ getcmdline_int( - int indent, // indent for inside conditionals - int init_ccline) // clear ccline first - { -+ static int depth = 0; // call depth - int c; - int i; - int j; -@@ -820,6 +821,9 @@ getcmdline_int( - int did_save_ccline = FALSE; - int cmdline_type; - -+ // one recursion level deeper -+ ++depth; -+ - if (ccline.cmdbuff != NULL) - { - // Being called recursively. Since ccline is global, we need to save -@@ -873,6 +877,13 @@ getcmdline_int( - ccline.cmdlen = indent; - } - -+ if (depth == 50) -+ { -+ // Somehow got into a loop recursively calling getcmdline(), bail out. -+ emsg(_(e_command_too_recursive)); -+ goto theend; -+ } -+ - ExpandInit(&xpc); - ccline.xpc = &xpc; - -@@ -2425,6 +2436,7 @@ theend: - { - char_u *p = ccline.cmdbuff; - -+ --depth; - if (did_save_ccline) - restore_cmdline(&save_ccline); - else -diff --git a/src/globals.h b/src/globals.h -index 5940f54..4d40de4 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1758,3 +1758,6 @@ EXTERN int did_repeated_msg INIT(= 0); - EXTERN char e_illegal_character_in_word[] - INIT(= N_("E1280: Illegal character in word")); - #endif -+ -+EXTERN char e_command_too_recursive[] -+ INIT(= N_("E169: Command too recursive")); -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index c55ee0b..4665c75 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -913,5 +913,16 @@ func Test_zero_line_search() - q! - endfunc - -+func Test_recursive_register() -+ let @= = '' -+ silent! ?e/ -+ let caught = 'no' -+ try -+ normal // -+ catch /E169:/ -+ let caught = 'yes' -+ endtry -+ call assert_equal('yes', caught) -+endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-1785.patch b/backport-CVE-2022-1785.patch deleted file mode 100644 index ebfd8fd6042fabfd67ffc65e093ab118f404e69a..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1785.patch +++ /dev/null @@ -1,76 +0,0 @@ -From e2bd8600b873d2cd1f9d667c28cba8b1dba18839 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 18 May 2022 13:11:57 +0100 -Subject: [PATCH] patch 8.2.4977: memory access error when substitute - expression changes window - -Problem: Memory access error when substitute expression changes window. -Solution: Disallow changing window in substitute expression. ---- - src/ex_cmds.c | 11 +++++++++++ - src/testdir/test_substitute.vim | 14 ++++++++++++++ - 2 files changed, 25 insertions(+) - -diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index aa97b40..0a22f59 100644 ---- a/src/ex_cmds.c -+++ b/src/ex_cmds.c -@@ -4289,12 +4289,17 @@ do_sub(exarg_T *eap) - // Save flags for recursion. They can change for e.g. - // :s/^/\=execute("s#^##gn") - subflags_save = subflags; -+ -+ // Disallow changing text or switching window in an expression. -+ ++textwinlock; - #endif - // get length of substitution part - sublen = vim_regsub_multi(®match, - sub_firstlnum - regmatch.startpos[0].lnum, - sub, sub_firstline, FALSE, p_magic, TRUE); - #ifdef FEAT_EVAL -+ --textwinlock; -+ - // If getting the substitute string caused an error, don't do - // the replacement. - // Don't keep flags set by a recursive call. -@@ -4395,9 +4400,15 @@ do_sub(exarg_T *eap) - mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len); - new_end += copy_len; - -+#ifdef FEAT_EVAL -+ ++textwinlock; -+#endif - (void)vim_regsub_multi(®match, - sub_firstlnum - regmatch.startpos[0].lnum, - sub, new_end, TRUE, p_magic, TRUE); -+#ifdef FEAT_EVAL -+ --textwinlock; -+#endif - sub_nsubs++; - did_sub = TRUE; - -diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim -index 3e6bc5c..bda96f6 100644 ---- a/src/testdir/test_substitute.vim -+++ b/src/testdir/test_substitute.vim -@@ -761,3 +761,17 @@ func Test_using_old_sub() - bwipe! - set nocompatible - endfunc -+ -+" This was switching windows in between computing the length and using it. -+func Test_sub_change_window() -+ silent! lfile -+ sil! norm o0000000000000000000000000000000000000000000000000000 -+ func Repl() -+ lopen -+ endfunc -+ silent! s/\%')/\=Repl() -+ bwipe! -+ bwipe! -+ delfunc Repl -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2022-1796.patch b/backport-CVE-2022-1796.patch deleted file mode 100644 index 1118b301448884d288a8f82403ab5c6bf1a7f9cf..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1796.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 28d032cc688ccfda18c5bbcab8b50aba6e18cde5 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 18 May 2022 16:29:08 +0100 -Subject: [PATCH] patch 8.2.4979: accessing freed memory when line is flushed - -Problem: Accessing freed memory when line is flushed. -Solution: Make a copy of the pattern to search for. ---- - src/testdir/test_tagjump.vim | 9 +++++++++ - src/window.c | 7 +++++++ - 2 files changed, 16 insertions(+) - -diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim -index 14ba1f7..24df68f 100644 ---- a/src/testdir/test_tagjump.vim -+++ b/src/testdir/test_tagjump.vim -@@ -556,4 +556,13 @@ func Test_tagline() - set tags& - endfunc - -+func Test_define_search() -+ " this was accessing freed memory -+ new -+ call setline(1, ['first line', '', '#define something 0']) -+ sil norm o0 -+ sil! norm  -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab -diff --git a/src/window.c b/src/window.c -index bb17167..ee2a374 100644 ---- a/src/window.c -+++ b/src/window.c -@@ -554,9 +554,16 @@ wingotofile: - CHECK_CMDWIN; - if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0) - break; -+ -+ // Make a copy, if the line was changed it will be freed. -+ ptr = vim_strnsave(ptr, len); -+ if (ptr == NULL) -+ break; -+ - find_pattern_in_path(ptr, 0, len, TRUE, - Prenum == 0 ? TRUE : FALSE, type, - Prenum1, ACTION_SPLIT, (linenr_T)1, (linenr_T)MAXLNUM); -+ vim_free(ptr); - curwin->w_set_curswant = TRUE; - break; - #endif --- -1.8.3.1 - diff --git a/backport-CVE-2022-1851.patch b/backport-CVE-2022-1851.patch deleted file mode 100644 index bf4a9a258bf8d0153f6ff7d253f38f2c97867740..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1851.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 78d52883e10d71f23ab72a3d8b9733b00da8c9ad Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 24 May 2022 13:57:54 +0100 -Subject: [PATCH] patch 8.2.5013: after text formatting cursor may be in an - invalid position - -Problem: After text formatting the cursor may be in an invalid position. -Solution: Correct the cursor position after formatting. - -Reference:https://github.com/vim/vim/commit/78d52883e10d71f23ab72a3d8b9733b00da8c9ad -Conflict: delete src/version.c and change src/ops.c file - ---- - src/ops.c | 3 +++ - src/testdir/test_textformat.vim | 12 ++++++++++++ - 2 files changed, 15 insertions(+) - -diff --git a/src/ops.c b/src/ops.c -index a79ef92..2a64db0 100644 ---- a/src/ops.c -+++ b/src/ops.c -@@ -2296,6 +2296,9 @@ op_format( - { - curwin->w_cursor = saved_cursor; - saved_cursor.lnum = 0; -+ -+ // formatting may have made the cursor position invalid -+ check_cursor(); - } - - if (oap->is_VIsual) -diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim -index 3a0552b..5e1d335 100644 ---- a/src/testdir/test_textformat.vim -+++ b/src/testdir/test_textformat.vim -@@ -509,3 +509,15 @@ func Test_crash_github_issue_5095() - augroup END - augroup! testing - endfunc -+ -+" This was leaving the cursor after the end of a line. Complicated way to -+" have the problem show up with valgrind. -+func Test_correct_cursor_position() -+ set encoding=iso8859 -+ new -+ norm a000“0 -+ sil! norm gggg0i0gw0gg -+ -+ bwipe! -+ set encoding=utf8 -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2022-1886.patch b/backport-CVE-2022-1886.patch deleted file mode 100644 index f7800d2cf015e3252c84b23c0afe24e2453dd260..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1886.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 2a585c85013be22f59f184d49612074fd9b115d7 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 25 May 2022 15:15:38 +0100 -Subject: [PATCH] patch 8.2.5016: access before start of text with a put - command - -Problem: Access before start of text with a put command. -Solution: Check the length is more than zero. ---- - src/register.c | 7 +++++-- - src/testdir/test_put.vim | 9 +++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/src/register.c b/src/register.c -index 7f77ada..87689f7 100644 ---- a/src/register.c -+++ b/src/register.c -@@ -2078,9 +2078,12 @@ error: - len = STRLEN(y_array[y_size - 1]); - col = (colnr_T)len - lendiff; - if (col > 1) -- curbuf->b_op_end.col = col - 1 -- - mb_head_off(y_array[y_size - 1], -+ { -+ curbuf->b_op_end.col = col - 1; -+ if (len > 0) -+ curbuf->b_op_end.col -= mb_head_off(y_array[y_size - 1], - y_array[y_size - 1] + len - 1); -+ } - else - curbuf->b_op_end.col = 0; - -diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim -index 07f6387..6df04cf 100644 ---- a/src/testdir/test_put.vim -+++ b/src/testdir/test_put.vim -@@ -143,3 +143,12 @@ func Test_multibyte_op_end_mark() - bwipe! - endfunc - -+" this was putting a mark before the start of a line -+func Test_put_empty_register() -+ new -+ norm yy -+ norm [Pi00ggv)s0 -+ sil! norm [P -+ bwipe! -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2022-1897.patch b/backport-CVE-2022-1897.patch deleted file mode 100644 index 77a67cc42044faa50c47835ace3a41728abcbb64..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1897.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 338f1fc0ee3ca929387448fe464579d6113fa76a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 26 May 2022 15:56:23 +0100 -Subject: [PATCH] patch 8.2.5023: substitute overwrites allocated buffer - -Problem: Substitute overwrites allocated buffer. -Solution: Disallow undo when in a substitute command. ---- - src/normal.c | 42 ++++++++++++++++++++--------------------- - src/testdir/test_substitute.vim | 23 ++++++++++++++++++++++ - src/undo.c | 6 ++++++ - 3 files changed, 50 insertions(+), 21 deletions(-) - -diff --git a/src/normal.c b/src/normal.c -index 71c05bb..e294706 100644 ---- a/src/normal.c -+++ b/src/normal.c -@@ -161,6 +161,22 @@ typedef void (*nv_func_T)(cmdarg_T *cap); - */ - - /* -+ * If currently editing a cmdline or text is locked: beep and give an error -+ * message, return TRUE. -+ */ -+ static int -+check_text_locked(oparg_T *oap) -+{ -+ if (text_locked()) -+ { -+ clearopbeep(oap); -+ text_locked_msg(); -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+/* - * This table contains one entry for every Normal or Visual mode command. - * The order doesn't matter, init_normal_cmds() will create a sorted index. - * It is faster when all keys from zero to '~' are present. -@@ -738,14 +754,9 @@ getcount: - goto normal_end; - } - -- if (text_locked() && (nv_cmds[idx].cmd_flags & NV_NCW)) -- { -- // This command is not allowed while editing a cmdline: beep. -- clearopbeep(oap); -- text_locked_msg(); -- goto normal_end; -- } -- if ((nv_cmds[idx].cmd_flags & NV_NCW) && curbuf_locked()) -+ if ((nv_cmds[idx].cmd_flags & NV_NCW) -+ && (check_text_locked(oap) || curbuf_locked())) -+ // this command is not allowed now - goto normal_end; - - /* -@@ -4155,12 +4166,8 @@ nv_gotofile(cmdarg_T *cap) - char_u *ptr; - linenr_T lnum = -1; - -- if (text_locked()) -- { -- clearopbeep(cap->oap); -- text_locked_msg(); -+ if (check_text_locked(cap->oap)) - return; -- } - if (curbuf_locked()) - { - clearop(cap->oap); -@@ -6288,14 +6295,7 @@ nv_g_cmd(cmdarg_T *cap) - - // "gQ": improved Ex mode - case 'Q': -- if (text_locked()) -- { -- clearopbeep(cap->oap); -- text_locked_msg(); -- break; -- } -- -- if (!checkclearopq(oap)) -+ if (!check_text_locked(cap->oap) && !checkclearopq(oap)) - do_exmode(TRUE); - break; - -diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim -index 3450c4f..b1d1bde 100644 ---- a/src/testdir/test_substitute.vim -+++ b/src/testdir/test_substitute.vim -@@ -801,3 +801,26 @@ func Test_sub_open_cmdline_win() - call delete('Xscript') - call delete('Xresult') - endfunc -+ -+" This was undoign a change in between computing the length and using it. -+func Do_Test_sub_undo_change() -+ new -+ norm o0000000000000000000000000000000000000000000000000000 -+ silent! s/\%')/\=Repl() -+ bwipe! -+endfunc -+ -+func Test_sub_undo_change() -+ func Repl() -+ silent! norm g- -+ endfunc -+ call Do_Test_sub_undo_change() -+ -+ func! Repl() -+ silent earlier -+ endfunc -+ call Do_Test_sub_undo_change() -+ -+ delfunc Repl -+endfunc -+ -diff --git a/src/undo.c b/src/undo.c -index 3dcf277..b3a91b5 100644 ---- a/src/undo.c -+++ b/src/undo.c -@@ -2283,6 +2283,12 @@ undo_time( - int above = FALSE; - int did_undo = TRUE; - -+ if (text_locked()) -+ { -+ text_locked_msg(); -+ return; -+ } -+ - // First make sure the current undoable change is synced. - if (curbuf->b_u_synced == FALSE) - u_sync(TRUE); --- -1.8.3.1 - diff --git a/backport-CVE-2022-1898.patch b/backport-CVE-2022-1898.patch deleted file mode 100644 index 743db7f8c9d7da16f95ca60cb134c96135ee0267..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1898.patch +++ /dev/null @@ -1,57 +0,0 @@ -From e2fa213cf571041dbd04ab0329303ffdc980678a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 26 May 2022 16:32:44 +0100 -Subject: [PATCH] patch 8.2.5024: using freed memory with "]d" - -Problem: Using freed memory with "]d". -Solution: Copy the pattern before searching. - ---- - src/normal.c | 6 ++++++ - src/testdir/test_tagjump.vim | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/normal.c b/src/normal.c -index e9e587d..71c05bb 100644 ---- a/src/normal.c -+++ b/src/normal.c -@@ -4425,6 +4425,11 @@ nv_brackets(cmdarg_T *cap) - clearop(cap->oap); - else - { -+ // Make a copy, if the line was changed it will be freed. -+ ptr = vim_strnsave(ptr, len); -+ if (ptr == NULL) -+ return; -+ - find_pattern_in_path(ptr, 0, len, TRUE, - cap->count0 == 0 ? !isupper(cap->nchar) : FALSE, - ((cap->nchar & 0xf) == ('d' & 0xf)) ? FIND_DEFINE : FIND_ANY, -@@ -4433,6 +4438,7 @@ nv_brackets(cmdarg_T *cap) - islower(cap->nchar) ? ACTION_SHOW : ACTION_GOTO, - cap->cmdchar == ']' ? curwin->w_cursor.lnum + 1 : (linenr_T)1, - (linenr_T)MAXLNUM); -+ vim_free(ptr); - curwin->w_set_curswant = TRUE; - } - } -diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim -index 24df68f..0eb9491 100644 ---- a/src/testdir/test_tagjump.vim -+++ b/src/testdir/test_tagjump.vim -@@ -563,6 +563,12 @@ func Test_define_search() - sil norm o0 - sil! norm  - bwipe! -+ -+ new somefile -+ call setline(1, ['first line', '', '#define something 0']) -+ sil norm 0o0 -+ sil! norm ]d -+ bwipe! - endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-1927.patch b/backport-CVE-2022-1927.patch deleted file mode 100644 index f0fb7ddc78a3ead272c6b0c16a40bc4dfe07ddc2..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1927.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 4d97a565ae8be0d4debba04ebd2ac3e75a0c8010 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 28 May 2022 14:25:35 +0100 -Subject: [PATCH] patch 8.2.5037: cursor position may be invalid after "0;" - range - -Problem: Cursor position may be invalid after "0;" range. -Solution: Check the cursor position when it was set by ";" in the range. ---- - src/ex_docmd.c | 24 +++++++++++++++++------- - src/testdir/test_excmd.vim | 9 +++++++++ - 2 files changed, 26 insertions(+), 7 deletions(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index a5ff463..b552440 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -2876,6 +2876,8 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - { - int address_count = 1; - linenr_T lnum; -+ int need_check_cursor = FALSE; -+ int ret = FAIL; - - // Repeat for all ',' or ';' separated addresses. - for (;;) -@@ -2925,7 +2927,7 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - lnum = get_address(eap, &eap->cmd, eap->addr_type, eap->skip, silent, - eap->addr_count == 0, address_count++); - if (eap->cmd == NULL) // error detected -- return FAIL; -+ goto theend; - if (lnum == MAXLNUM) - { - if (*eap->cmd == '%') // '%' - all lines -@@ -2970,14 +2972,14 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - // there is no Vim command which uses '%' and - // ADDR_WINDOWS or ADDR_TABS - *errormsg = _(e_invrange); -- return FAIL; -+ goto theend; - } - break; - case ADDR_TABS_RELATIVE: - case ADDR_UNSIGNED: - case ADDR_QUICKFIX: - *errormsg = _(e_invrange); -- return FAIL; -+ goto theend; - case ADDR_ARGUMENTS: - if (ARGCOUNT == 0) - eap->line1 = eap->line2 = 0; -@@ -3009,7 +3011,7 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - if (eap->addr_type != ADDR_LINES) - { - *errormsg = _(e_invrange); -- return FAIL; -+ goto theend; - } - - ++eap->cmd; -@@ -3017,11 +3019,11 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - { - fp = getmark('<', FALSE); - if (check_mark(fp) == FAIL) -- return FAIL; -+ goto theend; - eap->line1 = fp->lnum; - fp = getmark('>', FALSE); - if (check_mark(fp) == FAIL) -- return FAIL; -+ goto theend; - eap->line2 = fp->lnum; - ++eap->addr_count; - } -@@ -3036,10 +3038,13 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - if (!eap->skip) - { - curwin->w_cursor.lnum = eap->line2; -+ - // Don't leave the cursor on an illegal line or column, but do - // accept zero as address, so 0;/PATTERN/ works correctly. -+ // Check the cursor position before returning. - if (eap->line2 > 0) - check_cursor(); -+ need_check_cursor = TRUE; - } - } - else if (*eap->cmd != ',') -@@ -3055,7 +3060,12 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - if (lnum == MAXLNUM) - eap->addr_count = 0; - } -- return OK; -+ ret = OK; -+ -+theend: -+ if (need_check_cursor) -+ check_cursor(); -+ return ret; - } - - /* -diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim -index 992fc3d..aafee84 100644 ---- a/src/testdir/test_excmd.vim -+++ b/src/testdir/test_excmd.vim -@@ -44,3 +44,12 @@ func Test_buffers_lastused() - bwipeout bufb - bwipeout bufc - endfunc -+ -+" This was leaving the cursor in line zero -+func Test_using_zero_in_range() -+ new -+ norm o00 -+ silent! 0;s/\%') -+ bwipe! -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-CVE-2022-1942.patch b/backport-CVE-2022-1942.patch deleted file mode 100644 index e86664968a592e59c91a236a606dec6caafc841a..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1942.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 71223e2db87c2bf3b09aecb46266b56cda26191d Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 30 May 2022 15:23:09 +0100 -Subject: [PATCH] patch 8.2.5043: can open a cmdline window from a substitute - expression - -Problem: Can open a cmdline window from a substitute expression. -Solution: Disallow opening a command line window when text or buffer is - locked. - ---- - src/buffer.c | 7 +------ - src/ex_getln.c | 19 +++++++++++++++++++ - src/proto/ex_getln.pro | 1 + - src/testdir/test_substitute.vim | 25 +++++++++++++++++++++++++ - src/window.c | 5 +---- - 5 files changed, 47 insertions(+), 10 deletions(-) - -diff --git a/src/buffer.c b/src/buffer.c -index 88094ee..8fabbdb 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -2364,12 +2364,7 @@ buflist_getfile( - if (buf == curbuf) - return OK; - -- if (text_locked()) -- { -- text_locked_msg(); -- return FAIL; -- } -- if (curbuf_locked()) -+ if (text_or_buf_locked()) - return FAIL; - - // altfpos may be changed by getfile(), get it now -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 64b393d..d5fc38d 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -2588,6 +2588,21 @@ text_locked(void) - return text_and_win_locked() || textlock != 0; - } - -+/* -+ * Check for text, window or buffer locked. -+ * Give an error message and return TRUE if something is locked. -+ */ -+ int -+text_or_buf_locked(void) -+{ -+ if (text_locked()) -+ { -+ text_locked_msg(); -+ return TRUE; -+ } -+ return curbuf_locked(); -+} -+ - /* - * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is - * and give an error message. -@@ -4170,6 +4185,10 @@ open_cmdwin(void) - int save_KeyTyped; - #endif - -+ // Can't do this when text or buffer is locked. -+ if (text_or_buf_locked()) -+ return K_IGNORE; -+ - // Can't do this recursively. Can't do it when typing a password. - if (cmdwin_type != 0 - # if defined(FEAT_CRYPT) || defined(FEAT_EVAL) -diff --git a/src/proto/ex_getln.pro b/src/proto/ex_getln.pro -index f64bb1f..7597457 100644 ---- a/src/proto/ex_getln.pro -+++ b/src/proto/ex_getln.pro -@@ -7,6 +7,7 @@ int text_and_win_locked(void); - void text_locked_msg(void); - char *get_text_locked_msg(void); - int text_locked(void); -+int text_or_buf_locked(void); - int curbuf_locked(void); - int allbuf_locked(void); - char_u *getexline(int c, void *cookie, int indent, int do_concat); -diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim -index bda96f6..367f472 100644 ---- a/src/testdir/test_substitute.vim -+++ b/src/testdir/test_substitute.vim -@@ -1,4 +1,5 @@ - " Tests for multi-line regexps with ":s". -+source shared.vim - - func Test_multiline_subst() - enew! -@@ -775,3 +776,27 @@ func Test_sub_change_window() - delfunc Repl - endfunc - -+" This was opening a command line window from the expression -+func Test_sub_open_cmdline_win() -+ " the error only happens in a very specific setup, run a new Vim instance to -+ " get a clean starting point. -+ let lines =<< trim [SCRIPT] -+ norm o0000000000000000000000000000000000000000000000000000 -+ func Replace() -+ norm q/ -+ endfunc -+ s/\%')/\=Replace() -+ redir >Xresult -+ messages -+ redir END -+ qall! -+ [SCRIPT] -+ call writefile(lines, 'Xscript') -+ if RunVim([], [], '-u NONE -S Xscript') -+ let messages = readfile('Xresult') -+ call assert_match('E565: Not allowed to change text or change window', messages[3]) -+ endif -+ -+ call delete('Xscript') -+ call delete('Xresult') -+endfunc -diff --git a/src/window.c b/src/window.c -index 0a154b0..d8091f9 100644 ---- a/src/window.c -+++ b/src/window.c -@@ -4343,14 +4343,11 @@ win_goto(win_T *wp) - - if (ERROR_IF_POPUP_WINDOW) - return; -- if (text_and_win_locked()) -+ if (text_or_buf_locked()) - { - beep_flush(); -- text_locked_msg(); - return; - } -- if (curbuf_locked()) -- return; - - if (wp->w_buffer != curbuf) - reset_VIsual_and_resel(); --- -2.27.0 - diff --git a/backport-CVE-2022-1968.patch b/backport-CVE-2022-1968.patch deleted file mode 100644 index b25b827b5459ee5ff000a06a1574871117bf7f29..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-1968.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 409510c588b1eec1ae33511ae97a21eb8e110895 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 1 Jun 2022 15:23:13 +0100 -Subject: [PATCH] patch 8.2.5050: using freed memory when searching for pattern - in path - -Problem: Using freed memory when searching for pattern in path. -Solution: Make a copy of the line. ---- - src/search.c | 21 ++++++++++++++++++--- - src/testdir/test_tagjump.vim | 11 +++++++++++ - 2 files changed, 29 insertions(+), 3 deletions(-) - -diff --git a/src/search.c b/src/search.c -index 75f0c59..701a8ed 100644 ---- a/src/search.c -+++ b/src/search.c -@@ -5143,6 +5143,21 @@ search_stat( - } - - #if defined(FEAT_FIND_ID) || defined(PROTO) -+ -+/* -+ * Get line "lnum" and copy it into "buf[LSIZE]". -+ * The copy is made because the regexp may make the line invalid when using a -+ * mark. -+ */ -+ static char_u * -+get_line_and_copy(linenr_T lnum, char_u *buf) -+{ -+ char_u *line = ml_get(lnum); -+ -+ vim_strncpy(buf, line, LSIZE - 1); -+ return buf; -+} -+ - /* - * Find identifiers or defines in included files. - * If p_ic && (compl_cont_status & CONT_SOL) then ptr must be in lowercase. -@@ -5245,7 +5260,7 @@ find_pattern_in_path( - end_lnum = curbuf->b_ml.ml_line_count; - if (lnum > end_lnum) // do at least one line - lnum = end_lnum; -- line = ml_get(lnum); -+ line = get_line_and_copy(lnum, file_line); - - for (;;) - { -@@ -5573,7 +5588,7 @@ search_line: - { - if (lnum >= end_lnum) - goto exit_matched; -- line = ml_get(++lnum); -+ line = get_line_and_copy(++lnum, file_line); - } - else if (vim_fgets(line = file_line, - LSIZE, files[depth].fp)) -@@ -5783,7 +5798,7 @@ exit_matched: - { - if (++lnum > end_lnum) - break; -- line = ml_get(lnum); -+ line = get_line_and_copy(lnum, file_line); - } - already = NULL; - } -diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim -index 0eb9491..9e08a49 100644 ---- a/src/testdir/test_tagjump.vim -+++ b/src/testdir/test_tagjump.vim -@@ -571,4 +571,15 @@ func Test_define_search() - bwipe! - endfunc - -+" this was using a line from ml_get() freed by the regexp -+func Test_isearch_copy_line() -+ new -+ norm o -+ norm 0 -+ 0norm o -+ sil! norm bc0 -+ sil! isearch \%') -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-2000.patch b/backport-CVE-2022-2000.patch deleted file mode 100644 index 0f6e78eed1cfad98d9d473da71012ce1667690ee..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2000.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 44a3f3353e0407e9fffee138125a6927d1c9e7e5 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 6 Jun 2022 15:38:21 +0100 -Subject: [PATCH] patch 8.2.5063: error for a command may go over the end of - IObuff - -Problem: Error for a command may go over the end of IObuff. -Solution: Truncate the message. ---- - src/ex_docmd.c | 12 ++++++++++-- - src/testdir/test_cmdline.vim | 5 +++++ - 2 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index 1644573..7c00a26 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -3098,9 +3098,17 @@ checkforcmd( - static void - append_command(char_u *cmd) - { -- char_u *s = cmd; -- char_u *d; -+ size_t len = STRLEN(IObuff); -+ char_u *s = cmd; -+ char_u *d; - -+ if (len > IOSIZE - 100) -+ { -+ // Not enough space, truncate and put in "...". -+ d = IObuff + IOSIZE - 100; -+ d -= mb_head_off(IObuff, d); -+ STRCPY(d, "..."); -+ } - STRCAT(IObuff, ": "); - d = IObuff + STRLEN(IObuff); - while (*s != NUL && d - IObuff + 5 < IOSIZE) -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 2588a0d..735b0a5 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -930,4 +930,9 @@ func Test_cmdline_expr_register() - exe "sil! norm! ?\e0\0\?\e0\" - endfunc - -+func Test_long_error_message() -+ " the error should be truncated, not overrun IObuff -+ silent! norm Q00000000000000     000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000                                                                                                                                                                                                                         -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-2042.patch b/backport-CVE-2022-2042.patch deleted file mode 100644 index caf52937463c3f9ab761a4905cfb0220ab23775c..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2042.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 2813f38e021c6e6581c0c88fcf107e41788bc835 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 9 Jun 2022 19:54:24 +0100 -Subject: [PATCH] patch 8.2.5072: using uninitialized value and freed memory in - spell command - -Problem: Using uninitialized value and freed memory in spell command. -Solution: Initialize "attr". Check for empty line early. ---- - src/spell.c | 10 +++++++--- - src/testdir/test_spell_utf8.vim | 15 +++++++++++++++ - 2 files changed, 22 insertions(+), 3 deletions(-) - -diff --git a/src/spell.c b/src/spell.c -index d8310fa..5b25950 100644 ---- a/src/spell.c -+++ b/src/spell.c -@@ -1254,7 +1254,7 @@ spell_move_to( - char_u *line; - char_u *p; - char_u *endp; -- hlf_T attr; -+ hlf_T attr = 0; - int len; - #ifdef FEAT_SYN_HL - int has_syntax = syntax_present(wp); -@@ -1287,6 +1287,8 @@ spell_move_to( - - while (!got_int) - { -+ int empty_line; -+ - line = ml_get_buf(wp->w_buffer, lnum, FALSE); - - len = (int)STRLEN(line); -@@ -1319,7 +1321,9 @@ spell_move_to( - } - - // Copy the line into "buf" and append the start of the next line if -- // possible. -+ // possible. Note: this ml_get_buf() may make "line" invalid, check -+ // for empty line first. -+ empty_line = *skipwhite(line) == NUL; - STRCPY(buf, line); - if (lnum < wp->w_buffer->b_ml.ml_line_count) - spell_cat_line(buf + STRLEN(buf), -@@ -1467,7 +1471,7 @@ spell_move_to( - --capcol; - - // But after empty line check first word in next line -- if (*skipwhite(line) == NUL) -+ if (empty_line) - capcol = 0; - } - -diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim -index 491a406..efdecdc 100644 ---- a/src/testdir/test_spell_utf8.vim -+++ b/src/testdir/test_spell_utf8.vim -@@ -797,5 +797,20 @@ func Test_word_index() - call delete('Xtmpfile') - endfunc - -+func Test_check_empty_line() -+ " This was using freed memory -+ enew -+ spellgood! fl -+ norm z= -+ norm yy -+ sil! norm P]svc -+ norm P]s -+ -+ " set 'encoding' to clear the wordt list -+ set enc=latin1 -+ set enc=utf-8 -+ bwipe! -+endfunc -+ - - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-2124.patch b/backport-CVE-2022-2124.patch deleted file mode 100644 index 981a61505f7ebb7413bc7d410f648344d5d225ba..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2124.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e4463991b2c9243ae93462118b6d6f648852bb0c Mon Sep 17 00:00:00 2001 -From: lauk001 -Date: Tue, 21 Jun 2022 13:43:57 +0800 -Subject: [PATCH] CVE-2022-2124 - -Signed-off-by: lauk001 ---- - src/search.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/search.c b/src/search.c -index 75f0c59..87acb33 100644 ---- a/src/search.c -+++ b/src/search.c -@@ -4589,11 +4589,17 @@ current_quote( - - // Find out if we have a quote in the selection. - while (i <= col_end) -+ { -+ // check for going over the end of the line, which can happen if -+ // the line was changed after the Visual area was selected. -+ if (line[i] == NUL) -+ break; - if (line[i++] == quotechar) - { - selected_quote = TRUE; - break; - } -+ } - } - - if (!vis_empty && line[col_start] == quotechar) --- -2.33.0 - diff --git a/backport-CVE-2022-2125.patch b/backport-CVE-2022-2125.patch deleted file mode 100644 index 18126d8b3075207f96f7f19580857e1023c7992e..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2125.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0e8e938d497260dd57be67b4966cb27a5f72376f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 18 Jun 2022 12:51:11 +0100 -Subject: [PATCH] patch 8.2.5122: lisp indenting my run over the end of the - line - -Problem: Lisp indenting my run over the end of the line. -Solution: Check for NUL earlier. ---- - src/indent.c | 2 ++ - src/testdir/test_indent.vim | 10 ++++++++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/indent.c b/src/indent.c -index 4677d29..2d07e2e 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -1920,6 +1920,8 @@ get_lisp_indent(void) - } - } - } -+ if (*that == NUL) -+ break; - } - if (*that == '(' || *that == '[') - ++parencount; -diff --git a/src/testdir/test_indent.vim b/src/testdir/test_indent.vim -index 91e801a..f3b8b6b 100644 ---- a/src/testdir/test_indent.vim -+++ b/src/testdir/test_indent.vim -@@ -98,4 +98,14 @@ func Test_copyindent() - close! - endfunc - -+func Test_lisp_indent_quoted() -+ " This was going past the end of the line -+ new -+ setlocal lisp autoindent -+ call setline(1, ['"[', '=']) -+ normal Gvk= -+ -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-2126.patch b/backport-CVE-2022-2126.patch deleted file mode 100644 index 33196f52162471d2af8f1cb86bb22f363938159b..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2126.patch +++ /dev/null @@ -1,51 +0,0 @@ -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-CVE-2022-2175.patch b/backport-CVE-2022-2175.patch deleted file mode 100644 index a4d225c10113b6f623b1b69cf0553d3b8a50d7c9..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2175.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6046aded8da002b08d380db29de2ba0268b6616e Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 22 Jun 2022 13:51:54 +0100 -Subject: [PATCH] patch 8.2.5148: invalid memory access when using expression - on command line - -Problem: Invalid memory access when using an expression on the command line. -Solution: Make sure the position does not go negative. ---- - src/ex_getln.c | 6 ++++-- - src/testdir/test_cmdline.vim | 5 +++++ - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index aa01f80..887b47d 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -820,6 +820,7 @@ getcmdline_int( - cmdline_info_T save_ccline; - int did_save_ccline = FALSE; - int cmdline_type; -+ int save_new_cmdpos; - - // one recursion level deeper - ++depth; -@@ -1757,6 +1758,7 @@ getcmdline_int( - goto returncmd; // back to cmd mode - - case Ctrl_R: // insert register -+ save_new_cmdpos = new_cmdpos; - #ifdef USE_ON_FLY_SCROLL - dont_scroll = TRUE; // disallow scrolling here - #endif -@@ -1774,8 +1776,6 @@ getcmdline_int( - #ifdef FEAT_EVAL - /* - * Insert the result of an expression. -- * Need to save the current command line, to be able to enter -- * a new one... - */ - new_cmdpos = -1; - if (c == '=') -@@ -1816,6 +1816,8 @@ getcmdline_int( - } - #endif - } -+ new_cmdpos = save_new_cmdpos; -+ - redrawcmd(); - goto cmdline_changed; - -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 4665c75..2588a0d 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -925,4 +925,9 @@ func Test_recursive_register() - call assert_equal('yes', caught) - endfunc - -+" This was making the insert position negative -+func Test_cmdline_expr_register() -+ exe "sil! norm! ?\e0\0\?\e0\" -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-CVE-2022-2183.patch b/backport-CVE-2022-2183.patch deleted file mode 100644 index 03ddcc48e0638fe5544c181959105f22c78490a4..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2183.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 8eba2bd291b347e3008aa9e565652d51ad638cfa Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 22 Jun 2022 19:59:28 +0100 -Subject: [PATCH] patch 8.2.5151: reading beyond the end of the line with lisp - indenting - -Problem: Reading beyond the end of the line with lisp indenting. -Solution: Avoid going over the NUL at the end of the line. ---- - src/indent.c | 7 +++++-- - src/testdir/test_lispwords.vim | 12 +++++++++++- - 2 files changed, 16 insertions(+), 3 deletions(-) - -diff --git a/src/indent.c b/src/indent.c -index 2d07e2e..a58d6ea 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -1967,8 +1967,11 @@ get_lisp_indent(void) - amount += 2; - else - { -- that++; -- amount++; -+ if (*that != NUL) -+ { -+ that++; -+ amount++; -+ } - firsttry = amount; - - while (VIM_ISWHITE(*that)) -diff --git a/src/testdir/test_lispwords.vim b/src/testdir/test_lispwords.vim -index ff710b2..4144fb0 100644 ---- a/src/testdir/test_lispwords.vim -+++ b/src/testdir/test_lispwords.vim -@@ -1,4 +1,5 @@ --" Tests for 'lispwords' settings being global-local -+" Tests for 'lispwords' settings being global-local. -+" And other lisp indent stuff. - - set nocompatible viminfo+=nviminfo - -@@ -85,4 +86,13 @@ func Test_lisp_indent() - set nolisp - endfunc - -+func Test_lisp_indent_works() -+ " This was reading beyond the end of the line -+ new -+ exe "norm a\tü(\=" -+ set lisp -+ norm == -+ bwipe! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab --- -2.27.0 - diff --git a/backport-CVE-2022-2206.patch b/backport-CVE-2022-2206.patch deleted file mode 100644 index 6f930f1c33e77398ef6e651e78857daa00797ff7..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2206.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e178af5a586ea023622d460779fdcabbbfac0908 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 25 Jun 2022 19:54:09 +0100 -Subject: [PATCH] patch 8.2.5160: accessing invalid memory after changing - terminal size - -Problem: Accessing invalid memory after changing terminal size. -Solution: Adjust cmdline_row and msg_row to the value of Rows. ---- - src/term.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/term.c b/src/term.c -index 77cfa7d..307e3bf 100644 ---- a/src/term.c -+++ b/src/term.c -@@ -3223,6 +3223,12 @@ check_shellsize(void) - if (Rows < min_rows()) // need room for one window and command line - Rows = min_rows(); - limit_screen_size(); -+ -+ // make sure these values are not invalid -+ if (cmdline_row >= Rows) -+ cmdline_row = Rows - 1; -+ if (msg_row >= Rows) -+ msg_row = Rows - 1; - } - - /* --- -1.8.3.1 - diff --git a/backport-CVE-2022-2207.patch b/backport-CVE-2022-2207.patch deleted file mode 100644 index 613cc3880ea75b4b3774cf54c7274500d9e99cdd..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2207.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0971c7a4e537ea120a6bb2195960be8d0815e97b Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 26 Jun 2022 12:59:02 +0100 -Subject: [PATCH] patch 8.2.5162: reading before the start of the line with BS - in Replace mode - -Problem: Reading before the start of the line with BS in Replace mode. -Solution: Check the cursor column is more than zero. - ---- - src/edit.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/edit.c b/src/edit.c -index c4ede2b..bc0b7dc 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -4761,7 +4761,7 @@ ins_bs( - #endif - - // delete characters until we are at or before want_vcol -- while (vcol > want_vcol -+ while (vcol > want_vcol && curwin->w_cursor.col > 0 - && (cc = *(ml_get_cursor() - 1), VIM_ISWHITE(cc))) - ins_bs_one(&vcol); - --- -2.27.0 - diff --git a/backport-CVE-2022-2208.patch b/backport-CVE-2022-2208.patch deleted file mode 100644 index a426430613f80158e9f9d7b80400ada09cdbb5ea..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2208.patch +++ /dev/null @@ -1,63 +0,0 @@ -From cd38bb4d83c942c4bad596835c6766cbf32e5195 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 26 Jun 2022 14:04:07 +0100 -Subject: [PATCH] patch 8.2.5163: crash when deleting buffers in diff mode - -Problem: Crash when deleting buffers in diff mode. -Solution: Recompute diffs later. Skip window without a valid buffer. ---- - src/diff.c | 10 ++++++++-- - src/testdir/test_diffmode.vim | 12 ++++++++++++ - 2 files changed, 20 insertions(+), 2 deletions(-) - -diff --git a/src/diff.c b/src/diff.c -index f996904..8569a9f 100644 ---- a/src/diff.c -+++ b/src/diff.c -@@ -107,7 +107,12 @@ diff_buf_delete(buf_T *buf) - tp->tp_diffbuf[i] = NULL; - tp->tp_diff_invalid = TRUE; - if (tp == curtab) -- diff_redraw(TRUE); -+ { -+ // don't redraw right away, more might change or buffer state -+ // is invalid right now -+ need_diff_redraw = TRUE; -+ redraw_later(VALID); -+ } - } - } - } -@@ -655,7 +660,8 @@ diff_redraw( - - need_diff_redraw = FALSE; - FOR_ALL_WINDOWS(wp) -- if (wp->w_p_diff) -+ // when closing windows or wiping buffers skip invalid window -+ if (wp->w_p_diff && buf_valid(wp->w_buffer)) - { - redraw_win_later(wp, SOME_VALID); - #ifdef FEAT_FOLDING -diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim -index 61edbe2..5b48a75 100644 ---- a/src/testdir/test_diffmode.vim -+++ b/src/testdir/test_diffmode.vim -@@ -827,3 +827,15 @@ func Test_diff_maintains_change_mark() - bwipe! - bwipe! - endfunc -+ -+" This was trying to update diffs for a buffer being closed -+func Test_diff_only() -+ silent! lfile -+ set diff -+ lopen -+ norm o -+ silent! norm o -+ -+ set nodiff -+ %bwipe! -+endfunc --- -2.27.0 - diff --git a/backport-CVE-2022-2210.patch b/backport-CVE-2022-2210.patch deleted file mode 100644 index 3ec2772c4cc20cf238695cfef3621fc061c08752..0000000000000000000000000000000000000000 --- a/backport-CVE-2022-2210.patch +++ /dev/null @@ -1,67 +0,0 @@ -From c101abff4c6756db4f5e740fde289decb9452efa Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 26 Jun 2022 16:53:34 +0100 -Subject: [PATCH] patch 8.2.5164: invalid memory access after diff buffer - manipulations - -Problem: Invalid memory access after diff buffer manipulations. -Solution: Use zero offset when change removes all lines in a diff block. ---- - src/diff.c | 4 ++-- - src/testdir/test_diffmode.vim | 12 ++++++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/src/diff.c b/src/diff.c -index eddf33165628..91e5ae2f2f68 100644 ---- a/src/diff.c -+++ b/src/diff.c -@@ -391,9 +391,9 @@ diff_mark_adjust_tp( - // 2. 3. 4. 5.: inserted/deleted lines touching this diff. - if (deleted > 0) - { -+ off = 0; - if (dp->df_lnum[idx] >= line1) - { -- off = dp->df_lnum[idx] - lnum_deleted; - if (last <= line2) - { - // 4. delete all lines of diff -@@ -414,6 +414,7 @@ diff_mark_adjust_tp( - else - { - // 5. delete lines at or just before top of diff -+ off = dp->df_lnum[idx] - lnum_deleted; - n = off; - dp->df_count[idx] -= line2 - dp->df_lnum[idx] + 1; - check_unchanged = TRUE; -@@ -422,7 +423,6 @@ diff_mark_adjust_tp( - } - else - { -- off = 0; - if (last < line2) - { - // 2. delete at end of diff -diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim -index afa8f891be55..4c7aff5ccb6e 100644 ---- a/src/testdir/test_diffmode.vim -+++ b/src/testdir/test_diffmode.vim -@@ -840,3 +840,15 @@ func Test_diff_only() - set nodiff - %bwipe! - endfunc -+ -+" This was causing invalid diff block values -+" FIXME: somehow this causes a valgrind error when run directly but not when -+" run as a test. -+func Test_diff_manipulations() -+ set diff -+ split 0 -+ sil! norm R doobdeuR doobdeuR doobdeu -+ -+ set nodiff -+ %bwipe! -+endfunc --- -2.33.0 - diff --git a/backport-CVE-2022-2257.patch b/backport-CVE-2022-2257.patch index 86ea187f297abb3003c82fd1c8227e37db080948..5427c392bcac54e1aa6f4734fd64d2e1e6ce7067 100644 --- a/backport-CVE-2022-2257.patch +++ b/backport-CVE-2022-2257.patch @@ -8,33 +8,32 @@ Problem: Going past the end of a menu item with only modifier. Solution: Check for NUL. --- src/message.c | 4 ++-- - src/testdir/test_menu.vim | 14 ++++++++++++++ - 2 files changed, 16 insertions(+), 2 deletions(-) + src/testdir/test_menu.vim | 13 +++++++++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/message.c b/src/message.c -index 363dbe1..679a992 100644 +index 02380e9..becb280 100644 --- a/src/message.c +++ b/src/message.c -@@ -1735,8 +1735,8 @@ str2special( - *sp = str + 1; +@@ -1820,8 +1820,8 @@ str2special( + *sp = str + 1; } else -- // single-byte character or illegal byte +- // single-byte character or illegal byte - *sp = str + 1; -+ // single-byte character, NUL or illegal byte -+ *sp = str + (*str == NUL ? 0 : 1); ++ // single-byte character, NUL or illegal byte ++ *sp = str + (*str == NUL ? 0 : 1); - /* Make special keys and C0 control characters in <> form, also . - * Use only for lhs of a mapping. */ + // Make special keys and C0 control characters in <> form, also . + // Use only for lhs of a mapping. diff --git a/src/testdir/test_menu.vim b/src/testdir/test_menu.vim -index 0d6b78e..7e411cf 100644 +index c867162..df717cc 100644 --- a/src/testdir/test_menu.vim +++ b/src/testdir/test_menu.vim -@@ -84,3 +84,17 @@ func Test_menu_commands() +@@ -528,4 +528,17 @@ func Test_tmenu() + tunmenu Test + endfunc - unlet g:did_menu - endfun -+ +func Test_only_modifier() + exe "tmenu a.b \x80\xfc0" + let exp =<< trim [TEXT] @@ -48,6 +47,7 @@ index 0d6b78e..7e411cf 100644 + tunmenu a.b +endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2264.patch b/backport-CVE-2022-2264.patch index d8caacc22fd625425bde7de96824fe06c524c958..4803c92cd15aa1873eeedfc81d0e5cb0768c105d 100644 --- a/backport-CVE-2022-2264.patch +++ b/backport-CVE-2022-2264.patch @@ -12,23 +12,23 @@ Solution: Adjust the end mark position. 2 files changed, 14 insertions(+) diff --git a/src/register.c b/src/register.c -index 87689f7..51c14b8 100644 +index 93860ba..30e2001 100644 --- a/src/register.c +++ b/src/register.c -@@ -1819,6 +1819,8 @@ do_put( +@@ -1918,6 +1918,8 @@ do_put( vim_memset(ptr, ' ', (size_t)spaces); ptr += spaces; } -+ else -+ totlen -= spaces; // didn't use these spaces ++ else ++ totlen -= spaces; // didn't use these spaces } + // may insert some spaces after the new text - vim_memset(ptr, ' ', (size_t)bd.endspaces); diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim -index 6df04cf..c8d306a 100644 +index aa5aa2b..66438bd 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim -@@ -152,3 +152,15 @@ func Test_put_empty_register() +@@ -219,5 +219,17 @@ func Test_put_empty_register() bwipe! endfunc @@ -44,6 +44,8 @@ index 6df04cf..c8d306a 100644 + set selection& +endfunc + + + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2284.patch b/backport-CVE-2022-2284.patch index eb87d8b2ddfaae4ebc475079c323217ffdfcf212..8065da92befd9afa521ca7e74a1e5d5841d3cc89 100644 --- a/backport-CVE-2022-2284.patch +++ b/backport-CVE-2022-2284.patch @@ -1,7 +1,8 @@ From 3d51ce18ab1be4f9f6061568a4e7fabf00b21794 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 1 Jul 2022 15:26:15 +0100 -Subject: [PATCH] patch 9.0.0017: accessing memory beyond the end of the line +Subject: [PATCH] patch 9.0.0017: accessing memory beyond the end of the + line Problem: Accessing memory beyond the end of the line. Solution: Stop Visual mode when closing a window. @@ -11,10 +12,10 @@ Solution: Stop Visual mode when closing a window. 2 files changed, 14 insertions(+) diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index d21f8f1..ebb6f27 100644 +index c323062..e965266 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim -@@ -966,3 +966,15 @@ func Test_visual_block_with_substitute() +@@ -1469,5 +1469,17 @@ func Test_visual_paste_clipboard() bwipe! endfunc @@ -30,11 +31,13 @@ index d21f8f1..ebb6f27 100644 + bwipe! +endfunc + + + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/window.c b/src/window.c -index d8091f9..e0df540 100644 +index 992593b..c91ebbc 100644 --- a/src/window.c +++ b/src/window.c -@@ -2506,6 +2506,8 @@ win_close(win_T *win, int free_buf) +@@ -2594,6 +2594,8 @@ win_close(win_T *win, int free_buf) */ if (wp->w_buffer != curbuf) { diff --git a/backport-CVE-2022-2285.patch b/backport-CVE-2022-2285.patch index 38b9a9cb09cbdcebb06e7fe4643fa889056f6234..88c8d20aa9d9d4a8d6697315a99c08a00bd5036e 100644 --- a/backport-CVE-2022-2285.patch +++ b/backport-CVE-2022-2285.patch @@ -6,16 +6,16 @@ Subject: [PATCH] patch 9.0.0018: going over the end of the typahead Problem: Going over the end of the typahead. Solution: Put a NUL after the typeahead. --- - src/term.c | 1 + - src/testdir/test_mapping.vim | 9 +++++++++ - 2 files changed, 10 insertions(+) + src/term.c | 1 + + src/testdir/test_mapping.vim | 10 ++++++++++ + 2 files changed, 11 insertions(+) diff --git a/src/term.c b/src/term.c -index 307e3bf..ee80f0f 100644 +index 754ef82..7d7b84b 100644 --- a/src/term.c +++ b/src/term.c -@@ -4419,6 +4419,7 @@ check_termcode( - if (*tp == ESC && !p_ek && (State & INSERT)) +@@ -5393,6 +5393,7 @@ check_termcode( + if (*tp == ESC && !p_ek && (State & MODE_INSERT)) continue; + tp[len] = NUL; @@ -23,14 +23,13 @@ index 307e3bf..ee80f0f 100644 key_name[1] = NUL; // no key name found yet modifiers = 0; // no modifiers yet diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim -index d3abaff..55e6af0 100644 +index ace6453..2927ba7 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim -@@ -492,3 +492,12 @@ func Test_expr_map_restore_cursor() - call StopVimInTerminal(buf) - call delete('XtestExprMap') +@@ -1715,4 +1715,14 @@ func Test_map_after_timed_out_nop() + call delete('Xtest_map_after_timed_out_nop') endfunc -+ + +func Test_using_past_typeahead() + nnoremap :00 0 + exe "norm :set \x80\xfb0=0\" @@ -39,6 +38,9 @@ index d3abaff..55e6af0 100644 + exe "norm :set \x80\xfb0=\" + nunmap :00 +endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2286.patch b/backport-CVE-2022-2286.patch index 60d72ead4a8f0c41112ae6d4c3ca0263d59d2005..80b6e768c6c7cba332ba89ee06edbc106cf7d6ac 100644 --- a/backport-CVE-2022-2286.patch +++ b/backport-CVE-2022-2286.patch @@ -8,43 +8,43 @@ Problem: With some completion reading past end of string. Solution: Check the length of the string. --- src/insexpand.c | 14 ++++++++++++-- - src/testdir/test_ins_complete.vim | 7 +++++++ - 2 files changed, 19 insertions(+), 2 deletions(-) + src/testdir/test_ins_complete.vim | 8 ++++++++ + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/insexpand.c b/src/insexpand.c -index 50e0579..66a836e 100644 +index 4a5feac..734550f 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -2038,11 +2038,21 @@ ins_compl_prep(int c) - // but only do this, if the Popup is still visible - if (c == Ctrl_E) - { -+ char_u *p = NULL; +@@ -2209,11 +2209,21 @@ ins_compl_stop(int c, int prev_mode, int retval) + // but only do this, if the Popup is still visible + if (c == Ctrl_E) + { ++ char_u *p = NULL; + - ins_compl_delete(); - if (compl_leader != NULL) -- ins_bytes(compl_leader + ins_compl_len()); -+ p = compl_leader; - else if (compl_first_match != NULL) -- ins_bytes(compl_orig_text + ins_compl_len()); -+ p = compl_orig_text; -+ if (p != NULL) -+ { -+ int compl_len = ins_compl_len(); -+ int len = (int)STRLEN(p); + ins_compl_delete(); + if (compl_leader != NULL) +- ins_bytes(compl_leader + get_compl_len()); ++ p = compl_leader; + else if (compl_first_match != NULL) +- ins_bytes(compl_orig_text + get_compl_len()); ++ p = compl_orig_text; ++ if (p != NULL) ++ { ++ int compl_len = get_compl_len(); ++ int len = (int)STRLEN(p); + -+ if (len > compl_len) -+ ins_bytes_len(p + compl_len, len - compl_len); -+ } - retval = TRUE; - } ++ if (len > compl_len) ++ ins_bytes_len(p + compl_len, len - compl_len); ++ } + retval = TRUE; + } diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index 8f584d3..b7cfd29 100644 +index 365c646..20c2b4f 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -390,3 +390,10 @@ func Test_ins_complete_add() - bwipe! +@@ -2184,4 +2184,12 @@ func Test_complete_smartindent() + delfunction! FooBarComplete endfunc +func Test_complete_overrun() @@ -54,6 +54,8 @@ index 8f584d3..b7cfd29 100644 + bwipe! +endfunc + ++ + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2287.patch b/backport-CVE-2022-2287.patch index ea0b51bf2a606dfa02dc2aa3ced8311f47b4551b..68866dd6f895bff23d97e55c4e5495ad6937eb4e 100644 --- a/backport-CVE-2022-2287.patch +++ b/backport-CVE-2022-2287.patch @@ -5,19 +5,19 @@ Subject: [PATCH] patch 9.0.0021: invalid memory access when adding word to spell word list Problem: Invalid memory access when adding word with a control character to -the internal spell word list. + the internal spell word list. Solution: Disallow adding a word with control characters or a trailing -slash. + slash. --- src/spellfile.c | 21 +++++++++++++++++++-- src/testdir/test_spell.vim | 15 +++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/spellfile.c b/src/spellfile.c -index 5171572..aeeb6ad 100644 +index f0d6d96..4a0de52 100644 --- a/src/spellfile.c +++ b/src/spellfile.c -@@ -4343,6 +4343,23 @@ wordtree_alloc(spellinfo_T *spin) +@@ -4367,6 +4367,23 @@ wordtree_alloc(spellinfo_T *spin) } /* @@ -41,16 +41,16 @@ index 5171572..aeeb6ad 100644 * Store a word in the tree(s). * Always store it in the case-folded tree. For a keep-case word this is * useful when the word can also be used with all caps (no WF_FIXCAP flag) and -@@ -4367,7 +4384,7 @@ store_word( +@@ -4391,7 +4408,7 @@ store_word( char_u *p; // Avoid adding illegal bytes to the word tree. - if (enc_utf8 && !utf_valid_string(word, NULL)) + if (!valid_spell_word(word)) - return FAIL; + return FAIL; - (void)spell_casefold(word, len, foldword, MAXWLEN); -@@ -6171,7 +6188,7 @@ spell_add_word( + (void)spell_casefold(curwin, word, len, foldword, MAXWLEN); +@@ -6194,7 +6211,7 @@ spell_add_word( int i; char_u *spf; @@ -60,11 +60,11 @@ index 5171572..aeeb6ad 100644 emsg(_(e_illegal_character_in_word)); return; diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index 1f79907..bc4f41d 100644 +index 0fd5ed9..0187a17 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim -@@ -574,6 +574,21 @@ func Test_spell_screendump() - call delete('XtestSpell') +@@ -854,6 +854,21 @@ func Test_spellsuggest_too_deep() + bwipe! endfunc +func Test_spell_good_word_invalid() @@ -82,9 +82,9 @@ index 1f79907..bc4f41d 100644 + set enc=utf-8 +endfunc + - let g:test_data_aff1 = [ - \"SET ISO8859-1", - \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", + func LoadAffAndDic(aff_contents, dic_contents) + set enc=latin1 + set spellfile= -- 1.8.3.1 diff --git a/backport-CVE-2022-2288.patch b/backport-CVE-2022-2288.patch new file mode 100644 index 0000000000000000000000000000000000000000..ba7c2862788049b5efa040baaf59433c3e94742b --- /dev/null +++ b/backport-CVE-2022-2288.patch @@ -0,0 +1,54 @@ +From c6fdb15d423df22e1776844811d082322475e48a Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sat, 2 Jul 2022 13:43:21 +0100 +Subject: [PATCH] patch 9.0.0025: accessing beyond allocated memory with the + cmdline window + +Problem: Accessing beyond allocated memory when using the cmdline window in + Ex mode. +Solution: Use "*" instead of "'<,'>" for Visual mode. +--- + src/ex_docmd.c | 6 ++++-- + src/testdir/test_cmdline.vim | 8 ++++++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/ex_docmd.c b/src/ex_docmd.c +index 271e7e2..697337c 100644 +--- a/src/ex_docmd.c ++++ b/src/ex_docmd.c +@@ -3118,9 +3118,11 @@ parse_command_modifiers( + size_t len = STRLEN(cmd_start); + + // Special case: empty command uses "+": +- // "'<,'>mods" -> "mods'<,'>+ ++ // "'<,'>mods" -> "mods *+ ++ // Use "*" instead of "'<,'>" to avoid the command getting ++ // longer, in case is was allocated. + mch_memmove(orig_cmd, cmd_start, len); +- STRCPY(orig_cmd + len, "'<,'>+"); ++ STRCPY(orig_cmd + len, " *+"); + } + else + { +diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim +index 3685336..f0498a1 100644 +--- a/src/testdir/test_cmdline.vim ++++ b/src/testdir/test_cmdline.vim +@@ -2103,6 +2103,14 @@ func Test_cmdwin_insert_mode_close() + call assert_equal(1, winnr('$')) + endfunc + ++func Test_cmdwin_ex_mode_with_modifier() ++ " this was accessing memory after allocated text in Ex mode ++ new ++ call setline(1, ['some', 'text', 'lines']) ++ silent! call feedkeys("gQnormal vq:atopleft\\\", 'xt') ++ bwipe! ++endfunc ++ + " test that ";" works to find a match at the start of the first line + func Test_zero_line_search() + new +-- +1.8.3.1 + diff --git a/backport-CVE-2022-2289.patch b/backport-CVE-2022-2289.patch index e9ef81ed42d76334675bd0c8374d591e95e4e8c0..7e4aa5915edb81b1262e91e972653e24b0704925 100644 --- a/backport-CVE-2022-2289.patch +++ b/backport-CVE-2022-2289.patch @@ -6,18 +6,17 @@ Subject: [PATCH] patch 9.0.0026: accessing freed memory with diff put Problem: Accessing freed memory with diff put. Solution: Bail out when diff pointer is no longer valid. --- - src/diff.c | 24 ++++++++++++++++++++++-- - 1 file changed, 22 insertions(+), 2 deletions(-) + src/diff.c | 24 ++++++++++++++++++++++-- + 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/diff.c b/src/diff.c -index 8569a9f..d79dfee 100644 +index 91e5ae2..e4bafe2 100644 --- a/src/diff.c +++ b/src/diff.c -@@ -2560,6 +2560,20 @@ nv_diffgetput(int put, long count) - ex_diffgetput(&ea); +@@ -2643,6 +2643,20 @@ nv_diffgetput(int put, long count) } -+/* + /* + * Return TRUE if "diff" appears in the list of diff blocks of the current tab. + */ + static int @@ -31,10 +30,11 @@ index 8569a9f..d79dfee 100644 + return FALSE; +} + - /* ++/* * ":diffget" * ":diffput" -@@ -2817,9 +2831,9 @@ ex_diffgetput(exarg_T *eap) + */ +@@ -2899,9 +2913,9 @@ ex_diffgetput(exarg_T *eap) } } @@ -45,7 +45,7 @@ index 8569a9f..d79dfee 100644 mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added); if (curwin->w_cursor.lnum >= lnum) { -@@ -2841,7 +2855,13 @@ ex_diffgetput(exarg_T *eap) +@@ -2923,7 +2937,13 @@ ex_diffgetput(exarg_T *eap) #endif vim_free(dfree); } @@ -61,5 +61,5 @@ index 8569a9f..d79dfee 100644 dp->df_count[idx_to] = new_count; -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2304.patch b/backport-CVE-2022-2304.patch index ae0934cbc7007d46d91e54656d29f404e7badc40..41b3e32a8eb07bc7ccf01b86b97f03de70d43595 100644 --- a/backport-CVE-2022-2304.patch +++ b/backport-CVE-2022-2304.patch @@ -11,10 +11,10 @@ Solution: Limit the word length. 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/spell.c b/src/spell.c -index 5b25950..1d7a1ae 100644 +index d866a2d..24abce4 100644 --- a/src/spell.c +++ b/src/spell.c -@@ -3958,9 +3958,10 @@ spell_dump_compl( +@@ -3996,9 +3996,10 @@ spell_dump_compl( n = arridx[depth] + curi[depth]; ++curi[depth]; c = byts[n]; @@ -28,10 +28,10 @@ index 5b25950..1d7a1ae 100644 // they will appear in the keep-case tree. // Only use the word when the region matches. diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index ff50ecd..1f79907 100644 +index d3f56d8..a291eb5 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim -@@ -141,6 +141,18 @@ func Test_spellreall() +@@ -285,6 +285,18 @@ func Test_spellreall() bwipe! endfunc @@ -47,9 +47,9 @@ index ff50ecd..1f79907 100644 + nunmap 0 +endfunc + - func Test_spellsuggest_visual_end_of_line() - let enc_save = &encoding - set encoding=iso8859 + " Test spellsuggest({word} [, {max} [, {capital}]]) + func Test_spellsuggest() + " Verify suggestions are given even when spell checking is not enabled. -- 1.8.3.1 diff --git a/backport-CVE-2022-2343.patch b/backport-CVE-2022-2343.patch index 77bc1969472ada6eb8bfebd1b0620b3c1aa765b8..3830771f5b72c24c1a547e2b0a4e87364579ee01 100644 --- a/backport-CVE-2022-2343.patch +++ b/backport-CVE-2022-2343.patch @@ -1,22 +1,22 @@ -From caea66442d86e7bbba3bf3dc202c3c0d549b9853 Mon Sep 17 00:00:00 2001 +FROM CAEA66442D86E7BBBA3BF3DC202C3C0D549B9853 MON SEP 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Jul 2022 19:42:04 +0100 -Subject: [PATCH] patch 9.0.0045: reading past end of completion with a long - line +Subject: [PATCH] patch 9.0.0045: reading past end of completion with a + long line Problem: Reading past end of completion with a long line and 'infercase' set. Solution: Allocate the string if needed. --- - src/insexpand.c | 96 +++++++++++++++++++++++++++------------ - src/testdir/test_ins_complete.vim | 14 ++++++ - 2 files changed, 81 insertions(+), 29 deletions(-) + src/insexpand.c | 94 ++++++++++++++++++++++--------- + src/testdir/test_ins_complete.vim | 16 ++++++ + 2 files changed, 82 insertions(+), 28 deletions(-) diff --git a/src/insexpand.c b/src/insexpand.c -index 3b4d530..e8ba82e 100644 +index 734550f..0ecb656 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -408,29 +408,32 @@ ins_compl_accept_char(int c) +@@ -524,29 +524,32 @@ ins_compl_accept_char(int c) /* * Get the completed text by inferring the case of the originally typed text. @@ -54,7 +54,7 @@ index 3b4d530..e8ba82e 100644 if (has_mbyte) wca[i] = mb_ptr2char_adv(&p); else -@@ -450,7 +453,7 @@ ins_compl_infercase_gettext( +@@ -566,7 +569,7 @@ ins_compl_infercase_gettext( if (MB_ISUPPER(wca[i])) { // Rule 1 is satisfied. @@ -63,7 +63,7 @@ index 3b4d530..e8ba82e 100644 wca[i] = MB_TOLOWER(wca[i]); break; } -@@ -471,7 +474,7 @@ ins_compl_infercase_gettext( +@@ -587,7 +590,7 @@ ins_compl_infercase_gettext( if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i])) { // Rule 2 is satisfied. @@ -72,7 +72,7 @@ index 3b4d530..e8ba82e 100644 wca[i] = MB_TOUPPER(wca[i]); break; } -@@ -494,20 +497,52 @@ ins_compl_infercase_gettext( +@@ -610,20 +613,52 @@ ins_compl_infercase_gettext( } // Generate encoding specific output from wide character array. @@ -132,7 +132,7 @@ index 3b4d530..e8ba82e 100644 return IObuff; } -@@ -528,10 +563,12 @@ ins_compl_add_infercase( +@@ -644,10 +679,12 @@ ins_compl_add_infercase( { char_u *str = str_arg; char_u *p; @@ -147,7 +147,7 @@ index 3b4d530..e8ba82e 100644 if (p_ic && curbuf->b_p_inf && len > 0) { -@@ -541,44 +578,45 @@ ins_compl_add_infercase( +@@ -657,44 +694,45 @@ ins_compl_add_infercase( if (has_mbyte) { p = str; @@ -198,21 +198,21 @@ index 3b4d530..e8ba82e 100644 if (icase) flags |= CP_ICASE; -- return ins_compl_add(str, len, fname, NULL, dir, flags, FALSE); -+ res = ins_compl_add(str, len, fname, NULL, dir, flags, FALSE); +- return ins_compl_add(str, len, fname, NULL, NULL, dir, flags, FALSE); ++ res = ins_compl_add(str, len, fname, NULL, NULL, dir, flags, FALSE); + vim_free(tofree); + return res; } /* diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index b7cfd29..aa054f2 100644 +index 20c2b4f..f2daa02 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -397,3 +397,17 @@ func Test_complete_overrun() - bwipe! +@@ -2192,4 +2192,20 @@ func Test_complete_overrun() endfunc + +func Test_infercase_very_long_line() + " this was truncating the line when inferring case + new @@ -227,6 +227,9 @@ index b7cfd29..aa054f2 100644 + bwipe! + set noic noinfercase +endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab -- -1.8.3.1 +2.36.1 diff --git a/backport-CVE-2022-2344.patch b/backport-CVE-2022-2344.patch index b231a2e32f84316cb846cffbd8f2001b4e7071a7..fa51605286f05c975c0343e50beb5293156f8ad5 100644 --- a/backport-CVE-2022-2344.patch +++ b/backport-CVE-2022-2344.patch @@ -1,8 +1,8 @@ From baefde14550231f6468ac2ed2ed495bc381c0c92 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Jul 2022 19:59:49 +0100 -Subject: [PATCH] patch 9.0.0046: reading past end of completion with duplicate - match +Subject: [PATCH] patch 9.0.0046: reading past end of completion with + duplicate match Problem: Reading past end of completion with duplicate match. Solution: Check string length @@ -12,25 +12,25 @@ Solution: Check string length 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c -index bf98cee..50e0579 100644 +index 0ecb656..9c598a8 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -597,7 +597,8 @@ ins_compl_add( +@@ -786,7 +786,8 @@ ins_compl_add( { - if ( !(match->cp_flags & CP_ORIGINAL_TEXT) + if (!match_at_original_text(match) && STRNCMP(match->cp_str, str, len) == 0 - && match->cp_str[len] == NUL) + && ((int)STRLEN(match->cp_str) <= len + || match->cp_str[len] == NUL)) return NOTDONE; match = match->cp_next; - } while (match != NULL && match != compl_first_match); + } while (match != NULL && !is_first_match(match)); diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index e48a72c..8f584d3 100644 +index 5e5b1bb..2be6d06 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -380,3 +380,13 @@ func Test_ins_completeslash() - set completeslash= +@@ -2112,5 +2112,15 @@ func Test_infercase_very_long_line() + set noic noinfercase endfunc +func Test_ins_complete_add() @@ -43,6 +43,8 @@ index e48a72c..8f584d3 100644 + bwipe! +endfunc + + + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2345.patch b/backport-CVE-2022-2345.patch index 2f8340880903c6a8ad563e2b3ab13dcec41a1286..affe513187bb05ceb1f5b8e3468bbbe5a9c5a7fb 100644 --- a/backport-CVE-2022-2345.patch +++ b/backport-CVE-2022-2345.patch @@ -1,27 +1,28 @@ From 32acf1f1a72ebb9d8942b9c9d80023bf1bb668ea Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 7 Jul 2022 22:20:31 +0100 -Subject: [PATCH] patch 9.0.0047: using freed memory with recursive substitute +Subject: [PATCH] patch 9.0.0047: using freed memory with recursive + substitute Problem: Using freed memory with recursive substitute. Solution: Always make a copy for reg_prev_sub. --- src/ex_cmds.c | 11 ++++++++++- src/regexp.c | 8 ++++---- - src/testdir/test_regexp_latin.vim | 12 ++++++++++++ - 3 files changed, 26 insertions(+), 5 deletions(-) + src/testdir/test_regexp_latin.vim | 11 +++++++++++ + 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index 0a22f59..5a90c2f 100644 +index eb3016f..5253863 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c -@@ -3881,7 +3881,16 @@ do_sub(exarg_T *eap) - sub_copy = sub; +@@ -3994,7 +3994,16 @@ ex_substitute(exarg_T *eap) + sub_copy = sub; } else -- sub = regtilde(sub, p_magic); +- sub = regtilde(sub, magic_isset()); + { -+ char_u *newsub = regtilde(sub, p_magic); ++ char_u *newsub = regtilde(sub, magic_isset()); + + if (newsub != sub) + { @@ -34,10 +35,10 @@ index 0a22f59..5a90c2f 100644 /* * Check for a match on each line. diff --git a/src/regexp.c b/src/regexp.c -index 6849cba..c2f29c8 100644 +index 2cbe64e..f35a5e8 100644 --- a/src/regexp.c +++ b/src/regexp.c -@@ -1761,11 +1761,11 @@ regtilde(char_u *source, int magic) +@@ -1766,11 +1766,11 @@ regtilde(char_u *source, int magic) } } @@ -54,14 +55,13 @@ index 6849cba..c2f29c8 100644 } diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim -index a242d91..b668f87 100644 +index 1fe4699..dce6709 100644 --- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim -@@ -172,3 +172,15 @@ func Test_using_invalid_visual_position() - /\%V +@@ -1114,4 +1114,15 @@ func Test_using_two_engines_pattern() bwipe! endfunc -+ + +func Test_recursive_substitute_expr() + new + func Repl() @@ -73,6 +73,7 @@ index a242d91..b668f87 100644 + delfunc Repl +endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- 1.8.3.1 diff --git a/backport-CVE-2022-2522.patch b/backport-CVE-2022-2522.patch index dec7f485aded546bbbf9cd3aa58b4dae2126a4fb..f17c4aa7e19be8c2fdca83f7af162935fda14a1e 100644 --- a/backport-CVE-2022-2522.patch +++ b/backport-CVE-2022-2522.patch @@ -12,10 +12,10 @@ Solution: Terminate string with NUL. 2 files changed, 8 insertions(+) diff --git a/src/insexpand.c b/src/insexpand.c -index b1114b5..88dbac6 100644 +index b49a631..c505158 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -526,6 +526,7 @@ ins_compl_infercase_gettext( +@@ -642,6 +642,7 @@ ins_compl_infercase_gettext( // growarray. Add the character in the next round. if (ga_grow(&gap, IOSIZE) == FAIL) return (char_u *)"[failed]"; @@ -24,10 +24,10 @@ index b1114b5..88dbac6 100644 gap.ga_len = (int)STRLEN(IObuff); } diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index aa054f2..5e7353c 100644 +index 2be6d06..7bebc5d 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -408,6 +408,13 @@ func Test_infercase_very_long_line() +@@ -2108,6 +2108,13 @@ func Test_infercase_very_long_line() exe "normal 2Go\\\" call assert_equal(longLine, getline(3)) @@ -42,5 +42,5 @@ index aa054f2..5e7353c 100644 set noic noinfercase endfunc -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2571.patch b/backport-CVE-2022-2571.patch index 6a857728920490b32d91283cf37c2cf4a9c3e84c..ddd9380cf7926bbedb7aa83c0d91ec8f3965f4cc 100644 --- a/backport-CVE-2022-2571.patch +++ b/backport-CVE-2022-2571.patch @@ -1,39 +1,37 @@ From a6f9e300161f4cb54713da22f65b261595e8e614 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 28 Jul 2022 21:51:37 +0100 -Subject: [PATCH] patch 9.0.0102: reading past end of line with insert -mode +Subject: [PATCH] patch 9.0.0102: reading past end of line with insert mode completion Problem: Reading past end of line with insert mode completion. Solution: Check text length. --- src/insexpand.c | 2 +- - src/testdir/test_ins_complete.vim | 9 +++++++++ - 2 files changed, 10 insertions(+), 1 deletion(-) + src/testdir/test_ins_complete.vim | 8 ++++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c -index 88dbac6..a23d2d6 100644 +index 7339ce9..fc3eff0 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -2998,7 +2998,7 @@ ins_compl_get_exp(pos_T *ini) - { - char_u *tmp_ptr = ptr; +@@ -3501,7 +3501,7 @@ ins_comp_get_next_word_or_line( + { + char_u *tmp_ptr = ptr; -- if (compl_cont_status & CONT_ADDING) -+ if (compl_cont_status & CONT_ADDING && compl_length <= (int)STRLEN(tmp_ptr)) - { - tmp_ptr += compl_length; - // Skip if already inside a word. +- if (compl_status_adding()) ++ if (compl_status_adding() && compl_length <= (int)STRLEN(tmp_ptr)) + { + tmp_ptr += compl_length; + // Skip if already inside a word. diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index 5e7353c..39ece18 100644 +index 35c5785..2b0a294 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -418,3 +418,12 @@ func Test_infercase_very_long_line() +@@ -2142,5 +2142,13 @@ func Test_ins_complete_add() bwipe! - set noic noinfercase endfunc -+ + +func Test_ins_complete_end_of_line() + " this was reading past the end of the line + new @@ -42,6 +40,8 @@ index 5e7353c..39ece18 100644 + + bwipe! +endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2580.patch b/backport-CVE-2022-2580.patch new file mode 100644 index 0000000000000000000000000000000000000000..06e36bd5468e3a457932d6e68562f0876376422f Binary files /dev/null and b/backport-CVE-2022-2580.patch differ diff --git a/backport-CVE-2022-2581.patch b/backport-CVE-2022-2581.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6fe237409e4b1869b32cca36e11d7432db42964 --- /dev/null +++ b/backport-CVE-2022-2581.patch @@ -0,0 +1,65 @@ +From f50940531dd57135fe60aa393ac9d3281f352d88 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Fri, 29 Jul 2022 16:22:25 +0100 +Subject: [PATCH 002/123] patch 9.0.0105: illegal memory access when pattern + starts with illegal byte + +Problem: Illegal memory access when pattern starts with illegal byte. +Solution: Do not match a character with an illegal byte. +--- + src/regexp.c | 6 +++++- + src/testdir/test_regexp_utf8.vim | 15 +++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/src/regexp.c b/src/regexp.c +index 1a5cfd0..bec0464 100644 +--- a/src/regexp.c ++++ b/src/regexp.c +@@ -1641,7 +1641,11 @@ cstrchr(char_u *s, int c) + { + if (enc_utf8 && c > 0x80) + { +- if (utf_fold(utf_ptr2char(p)) == cc) ++ int uc = utf_ptr2char(p); ++ ++ // Do not match an illegal byte. E.g. 0xff matches 0xc3 0xbf, ++ // not 0xff. ++ if ((uc < 0x80 || uc != *p) && utf_fold(uc) == cc) + return p; + } + else if (*p == c || *p == cc) +diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim +index d88e263..e7672dd 100644 +--- a/src/testdir/test_regexp_utf8.vim ++++ b/src/testdir/test_regexp_utf8.vim +@@ -1,5 +1,7 @@ + " Tests for regexp in utf8 encoding + ++source shared.vim ++ + func s:equivalence_test() + let str = "AÀÃÂÃÄÅĀĂĄÇǞǠǺȂȦȺḀẠẢẤẦẨẪẬẮẰẲẴẶ BÆÉƒá¸‚ḄḆ CÇĆĈĊČƇȻḈꞒ DÄŽÄÆŠá¸Šá¸Œá¸Žá¸á¸’ EÈÉÊËĒĔĖĘĚȄȆȨɆḔḖḘḚḜẸẺẼẾỀỂỄỆ FƑḞꞘ GĜĞĠĢƓǤǦǴḠꞠ HĤĦȞḢḤḦḨḪⱧ IÃŒÃÃŽÃĨĪĬĮİƗÇȈȊḬḮỈỊ JĴɈ KÄ¶Æ˜Ç¨á¸°á¸²á¸´â±©ê€ LĹĻĽĿÅȽḶḸḺḼⱠ MḾṀṂ NÑŃŅŇǸṄṆṈṊꞤ OÃ’Ã“Ã”Ã•Ã–Ã˜ÅŒÅŽÅÆŸÆ Ç‘ǪǬǾȌȎȪȬȮȰṌṎá¹á¹’ỌỎá»á»’ỔỖỘỚỜỞỠỢ PƤṔṖⱣ QÉŠ RŔŖŘÈȒɌṘṚṜṞⱤꞦ SŚŜŞŠȘṠṢṤṦṨⱾꞨ TŢŤŦƬƮȚȾṪṬṮṰ UÙÚÛÜŨŪŬŮŰƯǕǙǛǓǗȔȖɄṲṴṶṸṺỤỦỨỪỬỮỰ VƲṼṾ WŴẀẂẄẆẈ XẊẌ YÃŶŸƳȲɎẎỲỴỶỸ ZŹŻŽƵáºáº’ẔⱫ aàáâãäåÄăąǎǟǡǻȃȧá¶á¸áºšáº¡áº£áº¥áº§áº©áº«áº­áº¯áº±áº³áºµáº·â±¥ bƀɓᵬᶀḃḅḇ cÃ§Ä‡Ä‰Ä‹ÄÆˆÈ¼á¸‰êž“êž” dÄđɗᵭá¶á¶‘ḋá¸á¸á¸‘ḓ eèéêëēĕėęěȅȇȩɇᶒḕḗḙḛá¸áº¹áº»áº½áº¿á»á»ƒá»…ệ fƒᵮᶂḟꞙ gÄğġģǥǧǵɠᶃḡꞡ hĥħȟḣḥḧḩḫẖⱨꞕ iìíîïĩīĭįÇȉȋɨᶖḭḯỉị jĵǰɉ kķƙǩᶄḱḳḵⱪê lĺļľŀłƚḷḹḻḽⱡ mᵯḿá¹á¹ƒ nñńņňʼnǹᵰᶇṅṇṉṋꞥ oòóôõöøÅÅőơǒǫǭǿÈÈȫȭȯȱɵá¹á¹á¹‘ṓá»á»á»‘ồổỗộớá»á»Ÿá»¡á»£ pƥᵱᵽᶈṕṗ qɋʠ rŕŗřȑȓÉɽᵲᵳᶉṛá¹á¹Ÿêž§ sÅ›Åşšșȿᵴᶊṡṣṥṧṩꞩ tţťŧƫƭțʈᵵṫṭṯṱẗⱦ uùúûüũūŭůűųǚǖưǔǘǜȕȗʉᵾᶙṳṵṷṹṻụủứừửữự vʋᶌṽṿ wŵáºáºƒáº…ẇẉẘ xẋẠyýÿŷƴȳÉáºáº™á»³á»µá»·á»¹ zźżžƶᵶᶎẑẓẕⱬ" + let groups = split(str) +@@ -560,6 +562,19 @@ func Test_match_invalid_byte() + call delete('Xinvalid') + endfunc + ++func Test_match_illegal_byte() ++ let lines =<< trim END ++ silent! buffer ÿ\c ++ next ÿ ++ 0scriptnames ++ source ++ END ++ call writefile(lines, 'Xregexp') ++ call system(GetVimCommand() .. ' -X -Z -e -s -S Xregexp -c qa!') ++ ++ call delete('Xregexp') ++endfunc ++ + func Test_match_too_complicated() + set regexpengine=1 + exe "noswapfile vsplit \xeb\xdb\x99" +-- +1.8.3.1 + diff --git a/backport-CVE-2022-2598.patch b/backport-CVE-2022-2598.patch index a765d8e2f1ec977fd047356a8cc7cae611648cda..7f13c2bc248ac4ad95c3427045586b6257afce6d 100644 --- a/backport-CVE-2022-2598.patch +++ b/backport-CVE-2022-2598.patch @@ -1,8 +1,7 @@ From 4e677b9c40ccbc5f090971b31dc2fe07bf05541d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 28 Jul 2022 18:44:27 +0100 -Subject: [PATCH] patch 9.0.0101: invalid memory access in diff mode with -"dp" +Subject: [PATCH] patch 9.0.0101: invalid memory access in diff mode with "dp" and undo Problem: Invalid memory access in diff mode with "dp" and undo. @@ -13,10 +12,10 @@ Solution: Make sure the line number does not go below one. 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/diff.c b/src/diff.c -index 2801c67..5328000 100644 +index e4bafe2..fb43eee 100644 --- a/src/diff.c +++ b/src/diff.c -@@ -452,7 +452,10 @@ diff_mark_adjust_tp( +@@ -464,7 +464,10 @@ diff_mark_adjust_tp( for (i = 0; i < DB_COUNT; ++i) if (tp->tp_diffbuf[i] != NULL && i != idx) { @@ -28,26 +27,25 @@ index 2801c67..5328000 100644 dp->df_count[i] += n; } } -@@ -2781,8 +2784,8 @@ ex_diffgetput(exarg_T *eap) +@@ -2863,8 +2866,8 @@ ex_diffgetput(exarg_T *eap) { // remember deleting the last line of the buffer buf_empty = curbuf->b_ml.ml_line_count == 1; -- ml_delete(lnum, FALSE); +- ml_delete(lnum); - --added; -+ if (ml_delete(lnum, FALSE) == OK) ++ if (ml_delete(lnum) == OK) + --added; } for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i) { diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim -index a75d0e5..d3b8f6c 100644 +index dcacd55..41f7fe3 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim -@@ -852,3 +852,17 @@ func Test_diff_manipulations() - set nodiff +@@ -1628,5 +1628,19 @@ func Test_diff_manipulations() %bwipe! endfunc -+ + +" This was causing the line number in the diff block to go below one. +" FIXME: somehow this causes a valgrind error when run directly but not when +" run as a test. @@ -61,6 +59,9 @@ index a75d0e5..d3b8f6c 100644 + bwipe! + set nodiff +endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2816.patch b/backport-CVE-2022-2816.patch new file mode 100644 index 0000000000000000000000000000000000000000..9359583ae0a477a10f85ad1c84ebd3392be9b966 --- /dev/null +++ b/backport-CVE-2022-2816.patch @@ -0,0 +1,58 @@ +From dbdd16b62560413abcc3c8e893cc3010ccf31666 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sun, 14 Aug 2022 21:46:07 +0100 +Subject: [PATCH] patch 9.0.0212: invalid memory access when compiling :unlet + +Problem: Invalid memory access when compiling :unlet. +Solution: Don't read past the end of the line. +--- + src/testdir/test_vim9_cmd.vim | 11 +++++++++-- + src/vim9cmds.c | 6 ++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim +index 16f534e..a40f261 100644 +--- a/src/testdir/test_vim9_cmd.vim ++++ b/src/testdir/test_vim9_cmd.vim +@@ -1704,12 +1704,19 @@ def Test_lockvar() + + lines =<< trim END + def _() +- s:0([], s:0) + lockv + enddef + defcomp + END +- v9.CheckScriptFailure(lines, 'E179', 2) ++ v9.CheckScriptFailure(lines, 'E179', 1) ++ ++ lines =<< trim END ++ def T() ++ unlet ++ enddef ++ defcomp ++ END ++ v9.CheckScriptFailure(lines, 'E179', 1) + enddef + + def Test_substitute_expr() +diff --git a/src/vim9cmds.c b/src/vim9cmds.c +index 35a3821..93032d6 100644 +--- a/src/vim9cmds.c ++++ b/src/vim9cmds.c +@@ -92,6 +92,12 @@ free_locals(cctx_T *cctx) + int + check_vim9_unlet(char_u *name) + { ++ if (*name == NUL) ++ { ++ semsg(_(e_argument_required_for_str), "unlet"); ++ return FAIL; ++ } ++ + if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL) + { + // "unlet s:var" is allowed in legacy script. +-- +2.36.1 + diff --git a/backport-CVE-2022-2817.patch b/backport-CVE-2022-2817.patch new file mode 100644 index 0000000000000000000000000000000000000000..440500321446c7d3b015f573e2c5a160ff125fa6 --- /dev/null +++ b/backport-CVE-2022-2817.patch @@ -0,0 +1,75 @@ +From 249e1b903a9c0460d618f6dcc59aeb8c03b24b20 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sun, 14 Aug 2022 22:23:02 +0100 +Subject: [PATCH] patch 9.0.0213: using freed memory with error in assert + argument + +Problem: Using freed memory with error in assert argument. +Solution: Make a copy of the error. +--- + src/testdir/test_assert.vim | 4 ++++ + src/testing.c | 18 ++++++++++++------ + 2 files changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim +index 27b2d73..7c9d090 100644 +--- a/src/testdir/test_assert.vim ++++ b/src/testdir/test_assert.vim +@@ -291,6 +291,10 @@ func Test_assert_fail_fails() + let exp = v:exception + endtry + call assert_match("E1174: String required for argument 5", exp) ++ ++ call assert_equal(1, assert_fails('c0', ['', '\1'])) ++ call assert_match("Expected '\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0]) ++ call remove(v:errors, 0) + endfunc + + func Test_assert_fails_in_try_block() +diff --git a/src/testing.c b/src/testing.c +index c49df4b..43b8d20 100644 +--- a/src/testing.c ++++ b/src/testing.c +@@ -597,6 +597,7 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) + int save_trylevel = trylevel; + int called_emsg_before = called_emsg; + char *wrong_arg_msg = NULL; ++ char_u *tofree = NULL; + + if (check_for_string_or_number_arg(argvars, 0) == FAIL + || check_for_opt_string_or_list_arg(argvars, 1) == FAIL +@@ -660,13 +661,17 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) + } + else if (list->lv_len == 2) + { +- tv = &list->lv_u.mat.lv_last->li_tv; +- actual = get_vim_var_str(VV_ERRMSG); +- expected = tv_get_string_buf_chk(tv, buf); +- if (!pattern_match(expected, actual, FALSE)) ++ // make a copy, an error in pattern_match() may free it ++ tofree = actual = vim_strsave(get_vim_var_str(VV_ERRMSG)); ++ if (actual != NULL) + { +- error_found = TRUE; +- expected_str = expected; ++ tv = &list->lv_u.mat.lv_last->li_tv; ++ expected = tv_get_string_buf_chk(tv, buf); ++ if (!pattern_match(expected, actual, FALSE)) ++ { ++ error_found = TRUE; ++ expected_str = expected; ++ } + } + } + } +@@ -749,6 +754,7 @@ theend: + msg_scrolled = 0; + lines_left = Rows; + VIM_CLEAR(emsg_assert_fails_msg); ++ vim_free(tofree); + set_vim_var_string(VV_ERRMSG, NULL, 0); + if (wrong_arg_msg != NULL) + emsg(_(wrong_arg_msg)); +-- +2.36.1 + diff --git a/backport-CVE-2022-2819.patch b/backport-CVE-2022-2819.patch new file mode 100644 index 0000000000000000000000000000000000000000..72f9f57a1f67d1f2d51d29a1b6574dae307f612b --- /dev/null +++ b/backport-CVE-2022-2819.patch @@ -0,0 +1,66 @@ +From d1d8f6bacb489036d0fd479c9dd3c0102c988889 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Sun, 14 Aug 2022 21:28:32 +0100 +Subject: [PATCH] patch 9.0.0211: invalid memory access when compiling :lockvar + +Problem: Invalid memory access when compiling :lockvar. +Solution: Don't read past the end of the line. +--- + src/testdir/test_vim9_cmd.vim | 9 +++++++++ + src/vim9cmds.c | 9 +++++++-- + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim +index 7db8e50..16f534e 100644 +--- a/src/testdir/test_vim9_cmd.vim ++++ b/src/testdir/test_vim9_cmd.vim +@@ -1701,6 +1701,15 @@ def Test_lockvar() + UnLockIt() + END + v9.CheckScriptFailure(lines, 'E46', 1) ++ ++ lines =<< trim END ++ def _() ++ s:0([], s:0) ++ lockv ++ enddef ++ defcomp ++ END ++ v9.CheckScriptFailure(lines, 'E179', 2) + enddef + + def Test_substitute_expr() +diff --git a/src/vim9cmds.c b/src/vim9cmds.c +index ad32c32..35a3821 100644 +--- a/src/vim9cmds.c ++++ b/src/vim9cmds.c +@@ -188,10 +188,17 @@ compile_lock_unlock( + size_t len; + char_u *buf; + isntype_T isn = ISN_EXEC; ++ char *cmd = eap->cmdidx == CMD_lockvar ? "lockvar" : "unlockvar"; + + if (cctx->ctx_skip == SKIP_YES) + return OK; + ++ if (*p == NUL) ++ { ++ semsg(_(e_argument_required_for_str), cmd); ++ return FAIL; ++ } ++ + // Cannot use :lockvar and :unlockvar on local variables. + if (p[1] != ':') + { +@@ -223,8 +230,6 @@ compile_lock_unlock( + ret = FAIL; + else + { +- char *cmd = eap->cmdidx == CMD_lockvar ? "lockvar" : "unlockvar"; +- + if (deep < 0) + vim_snprintf((char *)buf, len, "%s! %s", cmd, p); + else +-- +2.36.1 + diff --git a/backport-CVE-2022-2845.patch b/backport-CVE-2022-2845.patch index 4d768cf6d6f2396c5fab31029316dd387c6b11a2..262d3d78c6225e37e9c7f7cafa12bdba9cb7c854 100644 --- a/backport-CVE-2022-2845.patch +++ b/backport-CVE-2022-2845.patch @@ -12,10 +12,10 @@ Solution: When displaying "$" check the column is not negative. 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/edit.c b/src/edit.c -index e2052a7..15b0cc9 100644 +index a8e695c..96f47bd 100644 --- a/src/edit.c +++ b/src/edit.c -@@ -1769,8 +1769,9 @@ edit_unputchar(void) +@@ -1741,8 +1741,9 @@ edit_unputchar(void) * Only works when cursor is in the line that changes. */ void @@ -27,12 +27,12 @@ index e2052a7..15b0cc9 100644 if (!redrawing()) diff --git a/src/proto/edit.pro b/src/proto/edit.pro -index 49b9f4c..d0d3b17 100644 +index a233e40..f35ec1e 100644 --- a/src/proto/edit.pro +++ b/src/proto/edit.pro -@@ -7,7 +7,7 @@ void edit_putchar(int c, int highlight); - char_u *prompt_text(void); - int prompt_curpos_editable(void); +@@ -5,7 +5,7 @@ void ins_redraw(int ready); + void edit_putchar(int c, int highlight); + void set_insstart(linenr_T lnum, int col); void edit_unputchar(void); -void display_dollar(colnr_T col); +void display_dollar(colnr_T col_arg); @@ -40,10 +40,10 @@ index 49b9f4c..d0d3b17 100644 void truncate_spaces(char_u *line); void backspace_until_column(int col); diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 735b0a5..33808d7 100644 +index f0498a1..08e2de7 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim -@@ -935,4 +935,12 @@ func Test_long_error_message() +@@ -3439,4 +3439,12 @@ func Test_long_error_message() silent! norm Q00000000000000     000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000                                                                                                                                                                                                                         endfunc @@ -57,5 +57,5 @@ index 735b0a5..33808d7 100644 + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +2.36.1 diff --git a/backport-CVE-2022-2849.patch b/backport-CVE-2022-2849.patch new file mode 100644 index 0000000000000000000000000000000000000000..27adc77d906f87b4d86bd4615e5fa4387f24bc70 --- /dev/null +++ b/backport-CVE-2022-2849.patch @@ -0,0 +1,103 @@ +From f6d39c31d2177549a986d170e192d8351bd571e2 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Tue, 16 Aug 2022 17:50:38 +0100 +Subject: [PATCH] patch 9.0.0220: invalid memory access with for loop over NULL + string + +Problem: Invalid memory access with for loop over NULL string. +Solution: Make sure mb_ptr2len() consistently returns zero for NUL. +--- + src/globals.h | 3 ++- + src/mbyte.c | 21 +++++++++++++-------- + src/testdir/test_eval_stuff.vim | 12 ++++++++++++ + 3 files changed, 27 insertions(+), 9 deletions(-) + +diff --git a/src/globals.h b/src/globals.h +index 888f6e9..9b40be4 100644 +--- a/src/globals.h ++++ b/src/globals.h +@@ -1033,7 +1033,8 @@ EXTERN vimconv_T output_conv; // type of output conversion + * (DBCS). + * The value is set in mb_init(); + */ +-// length of char in bytes, including following composing chars ++// Length of char in bytes, including any following composing chars. ++// NUL has length zero. + EXTERN int (*mb_ptr2len)(char_u *p) INIT(= latin_ptr2len); + + // idem, with limit on string length +diff --git a/src/mbyte.c b/src/mbyte.c +index 3656880..782a7ad 100644 +--- a/src/mbyte.c ++++ b/src/mbyte.c +@@ -1077,24 +1077,28 @@ dbcs_char2bytes(int c, char_u *buf) + } + + /* +- * mb_ptr2len() function pointer. +- * Get byte length of character at "*p" but stop at a NUL. +- * For UTF-8 this includes following composing characters. +- * Returns 0 when *p is NUL. ++ * Get byte length of character at "*p". Returns zero when "*p" is NUL. ++ * Used for mb_ptr2len() when 'encoding' latin. + */ + int + latin_ptr2len(char_u *p) + { +- return MB_BYTE2LEN(*p); ++ return *p == NUL ? 0 : 1; + } + ++/* ++ * Get byte length of character at "*p". Returns zero when "*p" is NUL. ++ * Used for mb_ptr2len() when 'encoding' DBCS. ++ */ + static int +-dbcs_ptr2len( +- char_u *p) ++dbcs_ptr2len(char_u *p) + { + int len; + +- // Check if second byte is not missing. ++ if (*p == NUL) ++ return 0; ++ ++ // if the second byte is missing the length is 1 + len = MB_BYTE2LEN(*p); + if (len == 2 && p[1] == NUL) + len = 1; +@@ -2105,6 +2109,7 @@ utf_ptr2len_len(char_u *p, int size) + /* + * Return the number of bytes the UTF-8 encoding of the character at "p" takes. + * This includes following composing characters. ++ * Returns zero for NUL. + */ + int + utfc_ptr2len(char_u *p) +diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim +index c63082e..313d791 100644 +--- a/src/testdir/test_eval_stuff.vim ++++ b/src/testdir/test_eval_stuff.vim +@@ -75,6 +75,18 @@ func Test_for_invalid() + redraw + endfunc + ++func Test_for_over_null_string() ++ let save_enc = &enc ++ set enc=iso8859 ++ let cnt = 0 ++ for c in test_null_string() ++ let cnt += 1 ++ endfor ++ call assert_equal(0, cnt) ++ ++ let &enc = save_enc ++endfunc ++ + func Test_readfile_binary() + new + call setline(1, ['one', 'two', 'three']) +-- +2.36.1 + diff --git a/backport-CVE-2022-2862.patch b/backport-CVE-2022-2862.patch new file mode 100644 index 0000000000000000000000000000000000000000..672f9bfda13000a575ac8bd7deb4f8b69f0108c6 --- /dev/null +++ b/backport-CVE-2022-2862.patch @@ -0,0 +1,72 @@ +From 1889f499a4f248cd84e0e0bf6d0d820016774494 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Tue, 16 Aug 2022 19:34:44 +0100 +Subject: [PATCH] patch 9.0.0221: accessing freed memory if compiling nested + function fails + +Problem: Accessing freed memory if compiling nested function fails. +Solution: Mess up the variable name so that it won't be found. +--- + src/testdir/test_vim9_func.vim | 12 ++++++++++++ + src/vim9compile.c | 7 +++++-- + 2 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim +index 33a6615..426fde4 100644 +--- a/src/testdir/test_vim9_func.vim ++++ b/src/testdir/test_vim9_func.vim +@@ -907,6 +907,18 @@ def Test_nested_function() + v9.CheckScriptFailure(lines, 'E1173: Text found after enddef: burp', 3) + enddef + ++def Test_nested_function_fails() ++ var lines =<< trim END ++ def T() ++ def Func(g: string):string ++ enddef ++ Func() ++ enddef ++ silent! defcompile ++ END ++ v9.CheckScriptFailure(lines, 'E1069:') ++enddef ++ + def Test_not_nested_function() + echo printf('%d', + function('len')('xxx')) +diff --git a/src/vim9compile.c b/src/vim9compile.c +index b7f590e..fb39997 100644 +--- a/src/vim9compile.c ++++ b/src/vim9compile.c +@@ -822,6 +822,7 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free) + int r = FAIL; + compiletype_T compile_type; + isn_T *funcref_isn = NULL; ++ lvar_T *lvar = NULL; + + if (eap->forceit) + { +@@ -928,9 +929,8 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free) + else + { + // Define a local variable for the function reference. +- lvar_T *lvar = reserve_local(cctx, func_name, name_end - name_start, ++ lvar = reserve_local(cctx, func_name, name_end - name_start, + TRUE, ufunc->uf_func_type); +- + if (lvar == NULL) + goto theend; + if (generate_FUNCREF(cctx, ufunc, &funcref_isn) == FAIL) +@@ -949,6 +949,9 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free) + && compile_def_function(ufunc, TRUE, compile_type, cctx) == FAIL) + { + func_ptr_unref(ufunc); ++ if (lvar != NULL) ++ // Now the local variable can't be used. ++ *lvar->lv_name = '/'; // impossible value + goto theend; + } + +-- +2.36.1 + diff --git a/backport-CVE-2022-2874.patch b/backport-CVE-2022-2874.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7f89ad6d6f4ebcff9ca1c5f091e2061ea0b2079 --- /dev/null +++ b/backport-CVE-2022-2874.patch @@ -0,0 +1,73 @@ +From 4875d6ab068f09df88d24d81de40dcd8d56e243d Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 17 Aug 2022 15:55:51 +0100 +Subject: [PATCH] patch 9.0.0224: Using NULL pointer when skipping compiled + code + +Problem: Using NULL pointer when skipping compiled code. +Solution: Check for skipping. +--- + src/testdir/test_vim9_script.vim | 13 +++++++++++++ + src/vim9compile.c | 14 ++++++++++---- + 2 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim +index fc0ef15..75b3e9c 100644 +--- a/src/testdir/test_vim9_script.vim ++++ b/src/testdir/test_vim9_script.vim +@@ -2097,6 +2097,19 @@ def Test_for_skipped_block() + v9.CheckDefAndScriptSuccess(lines) + enddef + ++def Test_skipped_redir() ++ var lines =<< trim END ++ def T() ++ if 0 ++ redir =>l[0] ++ redir END ++ endif ++ enddef ++ defcompile ++ END ++ v9.CheckScriptSuccess(lines) ++enddef ++ + def Test_for_loop() + var lines =<< trim END + var result = '' +diff --git a/src/vim9compile.c b/src/vim9compile.c +index fb39997..a8fa5dc 100644 +--- a/src/vim9compile.c ++++ b/src/vim9compile.c +@@ -1157,11 +1157,14 @@ generate_loadvar( + generate_LOADV(cctx, name + 2); + break; + case dest_local: +- if (lvar->lv_from_outer > 0) +- generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer, ++ if (cctx->ctx_skip != SKIP_YES) ++ { ++ if (lvar->lv_from_outer > 0) ++ generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer, + type); +- else +- generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type); ++ else ++ generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type); ++ } + break; + case dest_expr: + // list or dict value should already be on the stack. +@@ -1944,6 +1947,9 @@ compile_assign_unlet( + } + } + ++ if (cctx->ctx_skip == SKIP_YES) ++ return OK; ++ + // Load the dict or list. On the stack we then have: + // - value (for assignment, not for :unlet) + // - index +-- +2.36.1 + diff --git a/backport-CVE-2022-2889.patch b/backport-CVE-2022-2889.patch new file mode 100644 index 0000000000000000000000000000000000000000..71014cd97b0b16dc4a89f9c258e4d18f79d71829 --- /dev/null +++ b/backport-CVE-2022-2889.patch @@ -0,0 +1,245 @@ +From 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 18 Aug 2022 13:28:31 +0100 +Subject: [PATCH] patch 9.0.0225: using freed memory with multiple line breaks + in expression + +Problem: Using freed memory with multiple line breaks in expression. +Solution: Free eval_tofree later. +--- + src/eval.c | 102 ++++++++++++++++++------------- + src/proto/eval.pro | 4 +- + src/testdir/test_vim9_script.vim | 13 ++++ + src/userfunc.c | 15 ----- + 4 files changed, 75 insertions(+), 59 deletions(-) + +diff --git a/src/eval.c b/src/eval.c +index 42b883e..60daca5 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -353,6 +353,63 @@ eval_to_string_skip( + return retval; + } + ++/* ++ * Initialize "evalarg" for use. ++ */ ++ void ++init_evalarg(evalarg_T *evalarg) ++{ ++ CLEAR_POINTER(evalarg); ++ ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20); ++} ++ ++/* ++ * If "evalarg->eval_tofree" is not NULL free it later. ++ * Caller is expected to overwrite "evalarg->eval_tofree" next. ++ */ ++ static void ++free_eval_tofree_later(evalarg_T *evalarg) ++{ ++ if (evalarg->eval_tofree != NULL) ++ { ++ if (ga_grow(&evalarg->eval_tofree_ga, 1) == OK) ++ ((char_u **)evalarg->eval_tofree_ga.ga_data) ++ [evalarg->eval_tofree_ga.ga_len++] ++ = evalarg->eval_tofree; ++ else ++ vim_free(evalarg->eval_tofree); ++ } ++} ++ ++/* ++ * After using "evalarg" filled from "eap": free the memory. ++ */ ++ void ++clear_evalarg(evalarg_T *evalarg, exarg_T *eap) ++{ ++ if (evalarg != NULL) ++ { ++ if (evalarg->eval_tofree != NULL) ++ { ++ if (eap != NULL) ++ { ++ // We may need to keep the original command line, e.g. for ++ // ":let" it has the variable names. But we may also need the ++ // new one, "nextcmd" points into it. Keep both. ++ vim_free(eap->cmdline_tofree); ++ eap->cmdline_tofree = *eap->cmdlinep; ++ *eap->cmdlinep = evalarg->eval_tofree; ++ } ++ else ++ vim_free(evalarg->eval_tofree); ++ evalarg->eval_tofree = NULL; ++ } ++ ++ ga_clear_strings(&evalarg->eval_tofree_ga); ++ VIM_CLEAR(evalarg->eval_tofree_lambda); ++ } ++} ++ + /* + * Skip over an expression at "*pp". + * Return FAIL for an error, OK otherwise. +@@ -435,8 +492,8 @@ skip_expr_concatenate( + // Do not free the first line, the caller can still use it. + *((char_u **)gap->ga_data) = NULL; + // Do not free the last line, "arg" points into it, free it +- // later. +- vim_free(evalarg->eval_tofree); ++ // later. Also free "eval_tofree" later if needed. ++ free_eval_tofree_later(evalarg); + evalarg->eval_tofree = + ((char_u **)gap->ga_data)[gap->ga_len - 1]; + ((char_u **)gap->ga_data)[gap->ga_len - 1] = NULL; +@@ -2274,7 +2331,7 @@ eval_next_line(char_u *arg, evalarg_T *evalarg) + } + else if (evalarg->eval_cookie != NULL) + { +- vim_free(evalarg->eval_tofree); ++ free_eval_tofree_later(evalarg); + evalarg->eval_tofree = line; + } + +@@ -2301,45 +2358,6 @@ skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg) + return p; + } + +-/* +- * Initialize "evalarg" for use. +- */ +- void +-init_evalarg(evalarg_T *evalarg) +-{ +- CLEAR_POINTER(evalarg); +- ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20); +-} +- +-/* +- * After using "evalarg" filled from "eap": free the memory. +- */ +- void +-clear_evalarg(evalarg_T *evalarg, exarg_T *eap) +-{ +- if (evalarg != NULL) +- { +- if (evalarg->eval_tofree != NULL) +- { +- if (eap != NULL) +- { +- // We may need to keep the original command line, e.g. for +- // ":let" it has the variable names. But we may also need the +- // new one, "nextcmd" points into it. Keep both. +- vim_free(eap->cmdline_tofree); +- eap->cmdline_tofree = *eap->cmdlinep; +- *eap->cmdlinep = evalarg->eval_tofree; +- } +- else +- vim_free(evalarg->eval_tofree); +- evalarg->eval_tofree = NULL; +- } +- +- ga_clear_strings(&evalarg->eval_tofree_ga); +- VIM_CLEAR(evalarg->eval_tofree_lambda); +- } +-} +- + /* + * The "evaluate" argument: When FALSE, the argument is only parsed but not + * executed. The function may return OK, but the rettv will be of type +diff --git a/src/proto/eval.pro b/src/proto/eval.pro +index e6cd892..27a13c9 100644 +--- a/src/proto/eval.pro ++++ b/src/proto/eval.pro +@@ -9,6 +9,8 @@ int eval_expr_valid_arg(typval_T *tv); + int eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv); + int eval_expr_to_bool(typval_T *expr, int *error); + char_u *eval_to_string_skip(char_u *arg, exarg_T *eap, int skip); ++void init_evalarg(evalarg_T *evalarg); ++void clear_evalarg(evalarg_T *evalarg, exarg_T *eap); + int skip_expr(char_u **pp, evalarg_T *evalarg); + int skip_expr_concatenate(char_u **arg, char_u **start, char_u **end, evalarg_T *evalarg); + char_u *typval2string(typval_T *tv, int convert); +@@ -34,8 +36,6 @@ int pattern_match(char_u *pat, char_u *text, int ic); + char_u *eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext); + char_u *eval_next_line(char_u *arg, evalarg_T *evalarg); + char_u *skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg); +-void init_evalarg(evalarg_T *evalarg); +-void clear_evalarg(evalarg_T *evalarg, exarg_T *eap); + int eval0(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg); + int eval0_retarg(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg, char_u **retarg); + int eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg); +diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim +index 75b3e9c..c09c0d2 100644 +--- a/src/testdir/test_vim9_script.vim ++++ b/src/testdir/test_vim9_script.vim +@@ -1560,6 +1560,19 @@ def Test_func_redefine_fails() + v9.CheckScriptFailure(lines, 'E1073:') + enddef + ++def Test_lambda_split() ++ # this was using freed memory, because of the split expression ++ var lines =<< trim END ++ vim9script ++ try ++ 0 ++ 0->(0 ++ ->a.0( ++ ->u ++ END ++ v9.CheckScriptFailure(lines, 'E1050:') ++enddef ++ + def Test_fixed_size_list() + # will be allocated as one piece of memory, check that changes work + var l = [1, 2, 3, 4] +diff --git a/src/userfunc.c b/src/userfunc.c +index 9b960b7..3777e03 100644 +--- a/src/userfunc.c ++++ b/src/userfunc.c +@@ -1371,7 +1371,6 @@ get_lambda_tv( + char_u *start, *end; + int *old_eval_lavars = eval_lavars_used; + int eval_lavars = FALSE; +- char_u *tofree1 = NULL; + char_u *tofree2 = NULL; + int equal_arrow = **arg == '('; + int white_error = FALSE; +@@ -1456,12 +1455,6 @@ get_lambda_tv( + ret = skip_expr_concatenate(arg, &start, &end, evalarg); + if (ret == FAIL) + goto errret; +- if (evalarg != NULL) +- { +- // avoid that the expression gets freed when another line break follows +- tofree1 = evalarg->eval_tofree; +- evalarg->eval_tofree = NULL; +- } + + if (!equal_arrow) + { +@@ -1584,10 +1577,6 @@ get_lambda_tv( + + theend: + eval_lavars_used = old_eval_lavars; +- if (evalarg != NULL && evalarg->eval_tofree == NULL) +- evalarg->eval_tofree = tofree1; +- else +- vim_free(tofree1); + vim_free(tofree2); + if (types_optional) + ga_clear_strings(&argtypes); +@@ -1606,10 +1595,6 @@ errret: + } + vim_free(fp); + vim_free(pt); +- if (evalarg != NULL && evalarg->eval_tofree == NULL) +- evalarg->eval_tofree = tofree1; +- else +- vim_free(tofree1); + vim_free(tofree2); + eval_lavars_used = old_eval_lavars; + return FAIL; +-- +2.36.1 + diff --git a/backport-CVE-2022-2923.patch b/backport-CVE-2022-2923.patch index 8d65e7dfc5370525919b62670443c15bd78b9e5e..774c45459c296a6eedce301ad3ffff458efc4ed5 100644 --- a/backport-CVE-2022-2923.patch +++ b/backport-CVE-2022-2923.patch @@ -9,14 +9,14 @@ Problem: Crash when using ":mkspell" with an empty .dic file. Solution: Check for an empty word tree. --- src/spellfile.c | 4 +++- - src/testdir/test_spellfile.vim | 11 +++++++++++ - 2 files changed, 14 insertions(+), 1 deletion(-) + src/testdir/test_spellfile.vim | 12 ++++++++++++ + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/spellfile.c b/src/spellfile.c -index aeeb6ad..08dcc1b 100644 +index 4a0de52..a4407fa 100644 --- a/src/spellfile.c +++ b/src/spellfile.c -@@ -5561,10 +5561,12 @@ sug_filltree(spellinfo_T *spin, slang_T *slang) +@@ -5585,10 +5585,12 @@ sug_filltree(spellinfo_T *spin, slang_T *slang) /* * Go through the whole case-folded tree, soundfold each word and put it @@ -31,11 +31,11 @@ index aeeb6ad..08dcc1b 100644 arridx[0] = 0; curi[0] = 1; diff --git a/src/testdir/test_spellfile.vim b/src/testdir/test_spellfile.vim -index 1382c02..4de7389 100644 +index 38d1ec0..e81aa65 100644 --- a/src/testdir/test_spellfile.vim +++ b/src/testdir/test_spellfile.vim -@@ -176,3 +176,14 @@ func Test_check_for_valid_word() - call assert_fails("spellgood! 0^B\xac", 'E1280:') +@@ -1160,4 +1160,16 @@ func Test_mkspellmem_opt() + call assert_fails('set mkspellmem=1000,50,0', 'E474:') endfunc +" this was using a NULL pointer @@ -49,6 +49,8 @@ index 1382c02..4de7389 100644 + call delete('XtestEmpty.spl') +endfunc + ++ + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +2.36.1 diff --git a/backport-CVE-2022-2946.patch b/backport-CVE-2022-2946.patch index 0811388c4f7c1f3c2cc78ae732dbcccc771ccb5c..91b7544ad9c3ee834918eab613797e628a662b9d 100644 --- a/backport-CVE-2022-2946.patch +++ b/backport-CVE-2022-2946.patch @@ -12,18 +12,18 @@ Solution: Make a copy of the tag name. 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/tag.c b/src/tag.c -index c00f5fb..aceb6e4 100644 +index 8a351cc..02f0818 100644 --- a/src/tag.c +++ b/src/tag.c -@@ -161,6 +161,7 @@ do_tag( +@@ -281,6 +281,7 @@ do_tag( char_u *buf_ffname = curbuf->b_ffname; // name to use for // priority computation - int use_tfu = 1; -+ char_u *tofree = NULL; + int use_tfu = 1; ++ char_u *tofree = NULL; // remember the matches for the last used tag static int num_matches = 0; -@@ -510,7 +511,12 @@ do_tag( +@@ -630,7 +631,12 @@ do_tag( * When desired match not found yet, try to find it (and others). */ if (use_tagstack) @@ -37,7 +37,7 @@ index c00f5fb..aceb6e4 100644 #if defined(FEAT_QUICKFIX) else if (g_do_tagpreview != 0) name = ptag_entry.tagname; -@@ -802,6 +808,7 @@ end_do_tag: +@@ -922,6 +928,7 @@ end_do_tag: g_do_tagpreview = 0; // don't do tag preview next time # endif @@ -46,11 +46,11 @@ index c00f5fb..aceb6e4 100644 return jumped_to_tag; #else diff --git a/src/testdir/test_tagfunc.vim b/src/testdir/test_tagfunc.vim -index 242aa3a..74ad3d1 100644 +index 05d8473..9582612 100644 --- a/src/testdir/test_tagfunc.vim +++ b/src/testdir/test_tagfunc.vim -@@ -81,4 +81,16 @@ func Test_tagfunc() - call delete('Xfile1') +@@ -389,4 +389,16 @@ func Test_tagfunc_callback() + %bw! endfunc +func Test_tagfunc_wipes_buffer() @@ -59,7 +59,7 @@ index 242aa3a..74ad3d1 100644 + endfunc + set tagfunc=g:Tag0unc0 + new -+ cal assert_fails('tag 0', 'E1299:') ++ cal assert_fails('tag 0', 'E987:') + + delfunc g:Tag0unc0 + set tagfunc= @@ -67,5 +67,5 @@ index 242aa3a..74ad3d1 100644 + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2980.patch b/backport-CVE-2022-2980.patch index 894a189782b7b71513c224bf66d806727a5788b8..318ae89526436b10dc9c0be69b8fc7f265ef51b4 100644 --- a/backport-CVE-2022-2980.patch +++ b/backport-CVE-2022-2980.patch @@ -6,15 +6,15 @@ Subject: [PATCH] patch 9.0.0259: crash with mouse click when not initialized Problem: Crash with mouse click when not initialized. Solution: Check TabPageIdxs[] is not NULL. --- - src/mouse.c | 107 ++++++++++++++++++----------------- - src/testdir/test_tabline.vim | 14 +++++ + src/mouse.c | 107 ++++++++++++++++++++++--------------------- + src/testdir/test_tabline.vim | 14 ++++++ 2 files changed, 69 insertions(+), 52 deletions(-) diff --git a/src/mouse.c b/src/mouse.c -index c94f322..4fdbdbd 100644 +index c39f614..12895f8 100644 --- a/src/mouse.c +++ b/src/mouse.c -@@ -448,74 +448,77 @@ do_mouse( +@@ -471,74 +471,77 @@ do_mouse( start_visual.lnum = 0; @@ -61,7 +61,7 @@ index c94f322..4fdbdbd 100644 - if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) - { - // double click opens new page -- end_visual_mode(); +- end_visual_mode_keep_button(); - tabpage_new(); - tabpage_move(c1 == 0 ? 9999 : c1 - 1); - } @@ -79,7 +79,7 @@ index c94f322..4fdbdbd 100644 + if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) + { + // double click opens new page - end_visual_mode(); + end_visual_mode_keep_button(); - } - } - else @@ -99,7 +99,7 @@ index c94f322..4fdbdbd 100644 - tp = curtab; + // It's like clicking on the status line of a window. + if (curwin != old_curwin) -+ end_visual_mode(); ++ end_visual_mode_keep_button(); + } + } else @@ -145,14 +145,13 @@ index c94f322..4fdbdbd 100644 // When 'mousemodel' is "popup" or "popup_setpos", translate mouse events: diff --git a/src/testdir/test_tabline.vim b/src/testdir/test_tabline.vim -index 383d239..d615429 100644 +index e58a412..556b859 100644 --- a/src/testdir/test_tabline.vim +++ b/src/testdir/test_tabline.vim -@@ -70,3 +70,17 @@ func Test_redrawtabline() - let &showtabline = showtabline_save - au! Bufadd +@@ -147,4 +147,18 @@ func Test_tabline_20_format_items_no_overrun() + set showtabline& tabline& endfunc -+ + +func Test_mouse_click_in_tab() + " This used to crash because TabPageIdxs[] was not initialized + let lines =<< trim END @@ -166,6 +165,8 @@ index 383d239..d615429 100644 + call delete('Xclickscript') +endfunc + ++ + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-2982.patch b/backport-CVE-2022-2982.patch new file mode 100644 index 0000000000000000000000000000000000000000..70ddb8af304943f43528b337fb1b5251ccf03dc4 --- /dev/null +++ b/backport-CVE-2022-2982.patch @@ -0,0 +1,73 @@ +From d6c67629ed05aae436164eec474832daf8ba7420 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 24 Aug 2022 20:07:22 +0100 +Subject: [PATCH] patch 9.0.0260: using freed memory when usinger + 'quickfixtextfunc' recursivelyxe + +Problem: Using freed memory when using 'quickfixtextfunc' recursively. +Solution: Do not allow for recursion. +--- + src/quickfix.c | 9 +++++++++ + src/testdir/test_quickfix.vim | 13 +++++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/src/quickfix.c b/src/quickfix.c +index c37caa5..5547233 100644 +--- a/src/quickfix.c ++++ b/src/quickfix.c +@@ -4656,6 +4656,11 @@ call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx) + { + callback_T *cb = &qftf_cb; + list_T *qftf_list = NULL; ++ static int recursive = FALSE; ++ ++ if (recursive) ++ return NULL; // this doesn't work properly recursively ++ recursive = TRUE; + + // If 'quickfixtextfunc' is set, then use the user-supplied function to get + // the text to display. Use the local value of 'quickfixtextfunc' if it is +@@ -4670,7 +4675,10 @@ call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx) + + // create the dict argument + if ((d = dict_alloc_lock(VAR_FIXED)) == NULL) ++ { ++ recursive = FALSE; + return NULL; ++ } + dict_add_number(d, "quickfix", (long)IS_QF_LIST(qfl)); + dict_add_number(d, "winid", (long)qf_winid); + dict_add_number(d, "id", (long)qfl->qf_id); +@@ -4693,6 +4701,7 @@ call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx) + dict_unref(d); + } + ++ recursive = FALSE; + return qftf_list; + } + +diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim +index 182d570..46b2cb6 100644 +--- a/src/testdir/test_quickfix.vim ++++ b/src/testdir/test_quickfix.vim +@@ -6334,4 +6334,17 @@ func Test_qflist_statusmsg() + %bw! + endfunc + ++func Test_quickfixtextfunc_recursive() ++ func s:QFTfunc(o) ++ cgete '0' ++ endfunc ++ copen ++ let &quickfixtextfunc = 's:QFTfunc' ++ cex "" ++ ++ let &quickfixtextfunc = '' ++ cclose ++endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab +-- +2.36.1 + diff --git a/backport-CVE-2022-3016.patch b/backport-CVE-2022-3016.patch index a2fcc3fd2ac42c3629768a1a965ae3d98d6ea7d9..2cd59bdec3c14bc0c2660b7989252432cdabf699 100644 --- a/backport-CVE-2022-3016.patch +++ b/backport-CVE-2022-3016.patch @@ -6,17 +6,17 @@ Subject: [PATCH] patch 9.0.0286: using freed memory when location list changed Problem: Using freed memory when location list changed in autocmd. Solution: Return QF_ABORT and handle it. (Yegappan Lakshmanan, -closes #10993) + closes #10993) --- src/quickfix.c | 28 ++++++++++++++++++---------- src/testdir/test_quickfix.vim | 17 +++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/quickfix.c b/src/quickfix.c -index a88475b..3ae5934 100644 +index 6af62e8..78f6880 100644 --- a/src/quickfix.c +++ b/src/quickfix.c -@@ -584,6 +584,7 @@ enum { +@@ -594,6 +594,7 @@ enum { QF_NOMEM = 3, QF_IGNORE_LINE = 4, QF_MULTISCAN = 5, @@ -24,7 +24,7 @@ index a88475b..3ae5934 100644 }; /* -@@ -3099,7 +3100,7 @@ qf_jump_to_usable_window(int qf_fnum, int newwin, int *opened_window) +@@ -3153,7 +3154,7 @@ qf_jump_to_usable_window(int qf_fnum, int newwin, int *opened_window) /* * Edit the selected file or help file. * Returns OK if successfully edited the file, FAIL on failing to open the @@ -33,9 +33,9 @@ index a88475b..3ae5934 100644 * when opening the buffer. */ static int -@@ -3144,14 +3145,14 @@ qf_jump_edit_buffer( +@@ -3199,14 +3200,14 @@ qf_jump_edit_buffer( { - emsg(_("E924: Current window was closed")); + emsg(_(e_current_window_was_closed)); *opened_window = FALSE; - return NOTDONE; + return QF_ABORT; @@ -50,7 +50,7 @@ index a88475b..3ae5934 100644 } // Check if the list was changed. The pointers may happen to be identical, -@@ -3164,7 +3165,7 @@ qf_jump_edit_buffer( +@@ -3219,7 +3220,7 @@ qf_jump_edit_buffer( emsg(_(e_current_quickfix_list_was_changed)); else emsg(_(e_current_location_list_was_changed)); @@ -59,7 +59,7 @@ index a88475b..3ae5934 100644 } return retval; -@@ -3262,7 +3263,8 @@ qf_jump_print_msg( +@@ -3317,7 +3318,8 @@ qf_jump_print_msg( * a new window. * Returns OK if successfully jumped or opened a window. Returns FAIL if not * able to jump/open a window. Returns NOTDONE if a file is not associated @@ -69,7 +69,7 @@ index a88475b..3ae5934 100644 */ static int qf_jump_open_window( -@@ -3288,7 +3290,7 @@ qf_jump_open_window( +@@ -3344,7 +3346,7 @@ qf_jump_open_window( emsg(_(e_current_quickfix_list_was_changed)); else emsg(_(e_current_location_list_was_changed)); @@ -78,7 +78,7 @@ index a88475b..3ae5934 100644 } // If currently in the quickfix window, find another window to show the -@@ -3312,7 +3314,7 @@ qf_jump_open_window( +@@ -3368,7 +3370,7 @@ qf_jump_open_window( emsg(_(e_current_quickfix_list_was_changed)); else emsg(_(e_current_location_list_was_changed)); @@ -87,7 +87,7 @@ index a88475b..3ae5934 100644 } return OK; -@@ -3323,7 +3325,7 @@ qf_jump_open_window( +@@ -3379,7 +3381,7 @@ qf_jump_open_window( * particular line/column, adjust the folds and display a message about the * jump. * Returns OK on success and FAIL on failing to open the file/buffer. Returns @@ -96,7 +96,7 @@ index a88475b..3ae5934 100644 * the file. */ static int -@@ -3451,14 +3453,20 @@ qf_jump_newwin(qf_info_T *qi, +@@ -3508,14 +3510,20 @@ qf_jump_newwin(qf_info_T *qi, retval = qf_jump_open_window(qi, qf_ptr, newwin, &opened_window); if (retval == FAIL) goto failed; @@ -120,11 +120,11 @@ index a88475b..3ae5934 100644 qf_ptr = NULL; } diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim -index c6c0f28..cf0fdf9 100644 +index 762fa8d..31d36ef 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim -@@ -350,6 +350,23 @@ func Test_lopen_bwipe_all() - call delete('Xresult') +@@ -6363,5 +6363,22 @@ func Test_quickfixtextfunc_recursive() + cclose endfunc +" Test for replacing the location list from an autocmd. This used to cause a @@ -145,8 +145,7 @@ index c6c0f28..cf0fdf9 100644 + call setloclist(0, [], 'f') +endfunc - " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile - " commands. + " vim: shiftwidth=2 sts=2 expandtab -- -2.27.0 +1.8.3.1 diff --git a/backport-CVE-2022-3037.patch b/backport-CVE-2022-3037.patch new file mode 100644 index 0000000000000000000000000000000000000000..67a54e3ceb01053b08677796451625990d02e2eb --- /dev/null +++ b/backport-CVE-2022-3037.patch @@ -0,0 +1,56 @@ +From 4f1b083be43f351bc107541e7b0c9655a5d2c0bb Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Mon, 29 Aug 2022 20:45:16 +0100 +Subject: [PATCH] patch 9.0.0322: crash when no errors and 'quickfixtextfunc' + is set + +Problem: Crash when no errors and 'quickfixtextfunc' is set. +Solution: Do not handle errors if there aren't any. +--- + src/quickfix.c | 2 +- + src/testdir/test_quickfix.vim | 16 ++++++++++++++++ + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/quickfix.c b/src/quickfix.c +index f6851ef..edf262c 100644 +--- a/src/quickfix.c ++++ b/src/quickfix.c +@@ -4743,7 +4743,7 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int qf_winid) + } + + // Check if there is anything to display +- if (qfl != NULL) ++ if (qfl != NULL && qfl->qf_start != NULL) + { + char_u dirname[MAXPATHL]; + int invalid_val = FALSE; +diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim +index cf803ca..27bed51 100644 +--- a/src/testdir/test_quickfix.vim ++++ b/src/testdir/test_quickfix.vim +@@ -4090,6 +4090,22 @@ func Xgetlist_empty_tests(cchar) + endif + endfunc + ++func Test_empty_list_quickfixtextfunc() ++ " This was crashing. Can only reproduce by running it in a separate Vim ++ " instance. ++ let lines =<< trim END ++ func s:Func(o) ++ cgetexpr '0' ++ endfunc ++ cope ++ let &quickfixtextfunc = 's:Func' ++ cgetfile [ex ++ END ++ call writefile(lines, 'Xquickfixtextfunc') ++ call RunVim([], [], '-e -s -S Xquickfixtextfunc -c qa') ++ call delete('Xquickfixtextfunc') ++endfunc ++ + func Test_getqflist() + call Xgetlist_empty_tests('c') + call Xgetlist_empty_tests('l') +-- +2.33.0 + diff --git a/backport-CVE-2022-3099.patch b/backport-CVE-2022-3099.patch index ff420a428d421de2608d3f2aa46f895e5283c988..6650510ce23f8a99f511dc4813e7490841fd1d52 100644 Binary files a/backport-CVE-2022-3099.patch and b/backport-CVE-2022-3099.patch differ diff --git a/backport-CVE-2022-3134.patch b/backport-CVE-2022-3134.patch index 6ba9b639ce38f4986c3a86fc5bd30b25683054a7..c139d5fb6a28ffa603b9ce56fbe3336103a62abe 100644 --- a/backport-CVE-2022-3134.patch +++ b/backport-CVE-2022-3134.patch @@ -7,27 +7,26 @@ Problem: Crash when 'tagfunc' closes the window. Solution: Bail out when the window was closed. --- - src/globals.h | 3 +++ + src/errors.h | 2 ++ src/tag.c | 10 ++++++++++ src/testdir/test_tagfunc.vim | 12 ++++++++++++ - 3 files changed, 25 insertions(+) + 3 files changed, 24 insertions(+) -diff --git a/src/globals.h b/src/globals.h -index 4d40de4..f8eabcf 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1761,3 +1761,6 @@ EXTERN char e_illegal_character_in_word[] - - EXTERN char e_command_too_recursive[] - INIT(= N_("E169: Command too recursive")); -+ +diff --git a/src/errors.h b/src/errors.h +index 43a1c9b..bfb4ae8 100644 +--- a/src/errors.h ++++ b/src/errors.h +@@ -3304,3 +3304,5 @@ EXTERN char e_could_not_check_for_pending_sigalrm_str[] + EXTERN char e_substitute_nesting_too_deep[] + INIT(= N_("E1290: substitute nesting too deep")); + #endif +EXTERN char e_window_unexpectedly_close_while_searching_for_tags[] + INIT(= N_("E1299: Window unexpectedly closed while searching for tags")); diff --git a/src/tag.c b/src/tag.c -index aceb6e4..e49a4d4 100644 +index 8edb0c7..b4915cb 100644 --- a/src/tag.c +++ b/src/tag.c -@@ -570,6 +570,16 @@ do_tag( +@@ -690,6 +690,16 @@ do_tag( max_num_matches = MAXCOL; // If less than max_num_matches // found: all matches found. @@ -45,10 +44,10 @@ index aceb6e4..e49a4d4 100644 // to the start. Avoids that the order changes when using // ":tnext" and jumping to another file. diff --git a/src/testdir/test_tagfunc.vim b/src/testdir/test_tagfunc.vim -index 68f2a50..cd60afe 100644 +index 9582612..c10a82d 100644 --- a/src/testdir/test_tagfunc.vim +++ b/src/testdir/test_tagfunc.vim -@@ -93,4 +93,16 @@ func Test_tagfunc_wipes_buffer() +@@ -401,4 +401,16 @@ func Test_tagfunc_wipes_buffer() set tagfunc= endfunc diff --git a/backport-CVE-2022-3153.patch b/backport-CVE-2022-3153.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c22b785e2831093ed3b46b5316b83b29bdcc409 --- /dev/null +++ b/backport-CVE-2022-3153.patch @@ -0,0 +1,87 @@ +From 1540d334a04d874c2aa9d26b82dbbcd4bc5a78de Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 7 Sep 2022 15:20:26 +0100 +Subject: [PATCH] patch 9.0.0404: crash when passing invalid arguments to + assert_fails() + +Problem: Crash when passing invalid arguments to assert_fails(). +Solution: Check for NULL string. +--- + src/testdir/test_assert.vim | 19 +++++++++++++++++-- + src/testing.c | 9 +++++++++ + 2 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim +index 7c9d090..9d8a018 100644 +--- a/src/testdir/test_assert.vim ++++ b/src/testdir/test_assert.vim +@@ -278,6 +278,21 @@ func Test_assert_fail_fails() + endtry + call assert_match("E1222: String or List required for argument 2", exp) + ++ try ++ call assert_equal(0, assert_fails('xxx', [#{one: 1}])) ++ catch ++ let exp = v:exception ++ endtry ++ call assert_match("E731: Using a Dictionary as a String", exp) ++ ++ let exp = '' ++ try ++ call assert_equal(0, assert_fails('xxx', ['E492', #{one: 1}])) ++ catch ++ let exp = v:exception ++ endtry ++ call assert_match("E731: Using a Dictionary as a String", exp) ++ + try + call assert_equal(1, assert_fails('xxx', 'E492', '', 'burp')) + catch +@@ -292,8 +307,8 @@ func Test_assert_fail_fails() + endtry + call assert_match("E1174: String required for argument 5", exp) + +- call assert_equal(1, assert_fails('c0', ['', '\1'])) +- call assert_match("Expected '\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0]) ++ call assert_equal(1, assert_fails('c0', ['', '\(.\)\1'])) ++ call assert_match("Expected '\\\\\\\\(.\\\\\\\\)\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0]) + call remove(v:errors, 0) + endfunc + +diff --git a/src/testing.c b/src/testing.c +index 43b8d20..b4c4ff4 100644 +--- a/src/testing.c ++++ b/src/testing.c +@@ -616,6 +616,11 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) + in_assert_fails = TRUE; + + do_cmdline_cmd(cmd); ++ ++ // reset here for any errors reported below ++ trylevel = save_trylevel; ++ suppress_errthrow = FALSE; ++ + if (called_emsg == called_emsg_before) + { + prepare_assert_error(&ga); +@@ -654,6 +659,8 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) + CHECK_LIST_MATERIALIZE(list); + tv = &list->lv_first->li_tv; + expected = tv_get_string_buf_chk(tv, buf); ++ if (expected == NULL) ++ goto theend; + if (!pattern_match(expected, actual, FALSE)) + { + error_found = TRUE; +@@ -667,6 +674,8 @@ f_assert_fails(typval_T *argvars, typval_T *rettv) + { + tv = &list->lv_u.mat.lv_last->li_tv; + expected = tv_get_string_buf_chk(tv, buf); ++ if (expected == NULL) ++ goto theend; + if (!pattern_match(expected, actual, FALSE)) + { + error_found = TRUE; +-- +2.27.0 + diff --git a/backport-CVE-2022-3234.patch b/backport-CVE-2022-3234.patch index 9dc9dc0dbb7843cc34bf0d64aa5b9292e3130682..32181f498844e8256a533c374e5cd926705ee228 100644 --- a/backport-CVE-2022-3234.patch +++ b/backport-CVE-2022-3234.patch @@ -12,10 +12,10 @@ Solution: Check for replacing NUL after Tab. 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ops.c b/src/ops.c -index 9926c00..b4185c7 100644 +index b930878..33cbd8e 100644 --- a/src/ops.c +++ b/src/ops.c -@@ -1183,6 +1183,8 @@ op_replace(oparg_T *oap, int c) +@@ -1160,6 +1160,8 @@ op_replace(oparg_T *oap, int c) while (LTOREQ_POS(curwin->w_cursor, oap->end)) { @@ -24,15 +24,15 @@ index 9926c00..b4185c7 100644 n = gchar_cursor(); if (n != NUL) { -@@ -1193,6 +1195,7 @@ op_replace(oparg_T *oap, int c) +@@ -1173,6 +1175,7 @@ op_replace(oparg_T *oap, int c) if (curwin->w_cursor.lnum == oap->end.lnum) - oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n); + oap->end.col += new_byte_len - old_byte_len; replace_character(c); + done = TRUE; } else { -@@ -1211,10 +1214,15 @@ op_replace(oparg_T *oap, int c) +@@ -1191,10 +1194,15 @@ op_replace(oparg_T *oap, int c) if (curwin->w_cursor.lnum == oap->end.lnum) getvpos(&oap->end, end_vcol); } @@ -51,11 +51,11 @@ index 9926c00..b4185c7 100644 int virtcols = oap->end.coladd; diff --git a/src/testdir/test_virtualedit.vim b/src/testdir/test_virtualedit.vim -index 25ca33f..451a996 100644 +index b31f3a2..0031b22 100644 --- a/src/testdir/test_virtualedit.vim +++ b/src/testdir/test_virtualedit.vim -@@ -343,4 +343,18 @@ func Test_yank_paste_small_del_reg() - set virtualedit= +@@ -537,4 +537,18 @@ func Test_global_local_virtualedit() + set virtualedit& endfunc +" this was replacing the NUL at the end of the line diff --git a/backport-CVE-2022-3235.patch b/backport-CVE-2022-3235.patch index 79995ae4acabfcbf4a6c4f6a0a34086f5bae6925..02870fb7c7016edf97450c30264c3ea4f3438b84 100644 --- a/backport-CVE-2022-3235.patch +++ b/backport-CVE-2022-3235.patch @@ -7,15 +7,15 @@ Subject: [PATCH] patch 9.0.0490: using freed memory with cmdwin and BufEnter Problem: Using freed memory with cmdwin and BufEnter autocmd. Solution: Make sure pointer to b_p_iminsert is still valid. --- - src/ex_getln.c | 6 +++++- + src/ex_getln.c | 8 ++++++-- src/testdir/test_cmdline.vim | 10 ++++++++++ - 2 files changed, 15 insertions(+), 1 deletion(-) + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c -index 8383eee..b299bd0 100644 +index 8dc03dc..535bfb5 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c -@@ -817,6 +817,7 @@ getcmdline_int( +@@ -1607,6 +1607,7 @@ getcmdline_int( #endif expand_T xpc; long *b_im_ptr = NULL; @@ -23,25 +23,27 @@ index 8383eee..b299bd0 100644 cmdline_info_T save_ccline; int did_save_ccline = FALSE; int cmdline_type; -@@ -938,6 +939,7 @@ getcmdline_int( +@@ -1703,6 +1704,7 @@ getcmdline_int( b_im_ptr = &curbuf->b_p_iminsert; else b_im_ptr = &curbuf->b_p_imsearch; + b_im_ptr_buf = curbuf; if (*b_im_ptr == B_IMODE_LMAP) - State |= LANGMAP; + State |= MODE_LANGMAP; #ifdef HAVE_INPUT_METHOD -@@ -1666,6 +1668,7 @@ getcmdline_int( +@@ -2060,7 +2062,8 @@ getcmdline_int( goto cmdline_not_changed; case Ctrl_HAT: -+ b_im_ptr = buf_valid(b_im_ptr_buf) ? b_im_ptr : NULL; - if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE)) - { - // ":lmap" mappings exists, toggle use of mappings. -@@ -2430,7 +2433,8 @@ returncmd: +- cmdline_toggle_langmap(b_im_ptr); ++ cmdline_toggle_langmap( ++ buf_valid(b_im_ptr_buf) ? b_im_ptr : NULL); + goto cmdline_not_changed; + + // case '@': only in very old vi +@@ -2573,7 +2576,8 @@ returncmd: + #endif - State = save_State; #ifdef HAVE_INPUT_METHOD - if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP) + if (b_im_ptr != NULL && buf_valid(b_im_ptr_buf) @@ -50,10 +52,10 @@ index 8383eee..b299bd0 100644 im_set_active(FALSE); #endif diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 33808d7..aceaba7 100644 +index 08e2de7..440df96 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim -@@ -943,4 +943,14 @@ func Test_cmdwin_virtual_edit() +@@ -3447,4 +3447,14 @@ func Test_cmdwin_virtual_edit() set ve= cpo-=$ endfunc @@ -69,5 +71,5 @@ index 33808d7..aceaba7 100644 + " vim: shiftwidth=2 sts=2 expandtab -- -2.33.0 +2.27.0 diff --git a/backport-CVE-2022-3256.patch b/backport-CVE-2022-3256.patch index a072973b421479957f7edeb446fe88cfab533f48..d72af1b11d3717ae155c4575fb3d266822a90ed8 100644 --- a/backport-CVE-2022-3256.patch +++ b/backport-CVE-2022-3256.patch @@ -11,10 +11,10 @@ Solution: Copy the mark before editing another buffer. 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/mark.c b/src/mark.c -index ba24220..9f817c0 100644 +index ade5a10..584db03 100644 --- a/src/mark.c +++ b/src/mark.c -@@ -249,17 +249,19 @@ movemark(int count) +@@ -221,17 +221,19 @@ movemark(int count) fname2fnum(jmp); if (jmp->fmark.fnum != curbuf->b_fnum) { @@ -40,11 +40,11 @@ index ba24220..9f817c0 100644 } else diff --git a/src/testdir/test_marks.vim b/src/testdir/test_marks.vim -index 96a7766..47cdfb0 100644 +index 12501a3..20fb304 100644 --- a/src/testdir/test_marks.vim +++ b/src/testdir/test_marks.vim -@@ -190,4 +190,17 @@ func Test_lockmarks_with_put() - bwipe! +@@ -305,4 +305,17 @@ func Test_getmarklist() + close! endfunc +" This was using freed memory diff --git a/backport-CVE-2022-3278.patch b/backport-CVE-2022-3278.patch new file mode 100644 index 0000000000000000000000000000000000000000..67255d29f614a37eb2b82f0934a7aadd15b0bcf6 --- /dev/null +++ b/backport-CVE-2022-3278.patch @@ -0,0 +1,56 @@ +From 69082916c8b5d321545d60b9f5facad0a2dd5a4e Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 22 Sep 2022 21:35:19 +0100 +Subject: [PATCH] patch 9.0.0552: crash when using NUL in buffer that uses + :source + +Problem: Crash when using NUL in buffer that uses :source. +Solution: Don't get a next line when skipping over NL. +--- + src/eval.c | 2 +- + src/testdir/test_source.vim | 17 +++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/src/eval.c b/src/eval.c +index 60daca5..8df374a 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -2278,7 +2278,7 @@ eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext) + + if (next != NULL) + { +- *getnext = TRUE; ++ *getnext = *p != NL; + return skipwhite(next); + } + } +diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim +index 4736e93..d6aed57 100644 +--- a/src/testdir/test_source.vim ++++ b/src/testdir/test_source.vim +@@ -665,5 +665,22 @@ func Test_source_buffer_long_line() + call delete('Xtest.vim') + endfunc + ++func Test_source_buffer_with_NUL_char() ++ " This was trying to use a line below the buffer. ++ let lines =<< trim END ++ if !exists('g:loaded') ++ let g:loaded = 1 ++ source ++ endif ++ END ++ " Can't have a NL in heredoc ++ let lines += ["silent! vim9 echo [0 \ ? 'a' : 'b']"] ++ call writefile(lines, 'XsourceNul', '') ++ edit XsourceNul ++ source ++ ++ bwipe! ++endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab +-- +2.27.0 + diff --git a/backport-CVE-2022-3296.patch b/backport-CVE-2022-3296.patch index 6c17c41cf3c251e18e19f6b9f0707787ef3e06c1..4d790bc52dda5bf6ee51297e6406ec5f9e0ef19d 100644 --- a/backport-CVE-2022-3296.patch +++ b/backport-CVE-2022-3296.patch @@ -1,21 +1,22 @@ From 96b9bf8f74af8abf1e30054f996708db7dc285be Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 24 Sep 2022 17:24:12 +0100 -Subject: [PATCH] patch 9.0.0577: buffer underflow with unexpected :finally +Subject: patch 9.0.0577: buffer underflow with unexpected :finally Problem: Buffer underflow with unexpected :finally. Solution: Check CSF_TRY can be found. --- - src/ex_eval.c | 487 +++++++++++++++++++++++++------------------------- - 1 file changed, 243 insertions(+), 244 deletions(-) + src/ex_eval.c | 523 +++++++++++++++++----------------- + src/testdir/test_trycatch.vim | 22 ++ + 2 files changed, 282 insertions(+), 263 deletions(-) diff --git a/src/ex_eval.c b/src/ex_eval.c -index 645b27d..0c2dad8 100644 +index 5721b766e..77d6e8bb9 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c -@@ -1646,119 +1646,117 @@ ex_finally(exarg_T *eap) - int pending = CSTP_NONE; - struct condstack *cstack = eap->cstack; +@@ -1935,128 +1935,127 @@ ex_finally(exarg_T *eap) + if (cmdmod_error(FALSE)) + return; - if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) + for (idx = cstack->cs_idx; idx >= 0; --idx) @@ -23,7 +24,7 @@ index 645b27d..0c2dad8 100644 + break; + if (cstack->cs_trylevel <= 0 || idx < 0) + { - eap->errmsg = N_("E606: :finally without :try"); + eap->errmsg = _(e_finally_without_try); - else + return; + } @@ -49,16 +50,17 @@ index 645b27d..0c2dad8 100644 + // ":continue", ":break", ":return", or ":finish". + pending = CSTP_ERROR; + } + +- if (cstack->cs_flags[idx] & CSF_FINALLY) + if (cstack->cs_flags[idx] & CSF_FINALLY) + { + // Give up for a multiple ":finally" and ignore it. -+ eap->errmsg = N_("E607: multiple :finally"); ++ eap->errmsg = _(e_multiple_finally); + return; + } + rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, + &cstack->cs_looplevel); - -- if (cstack->cs_flags[idx] & CSF_FINALLY) ++ + /* + * Don't do something when the corresponding try block never got active + * (because of an inactive surrounding conditional or after an error or @@ -77,7 +79,7 @@ index 645b27d..0c2dad8 100644 + if (dbg_check_skipped(eap)) { - // Give up for a multiple ":finally" and ignore it. -- eap->errmsg = N_("E607: multiple :finally"); +- eap->errmsg = _(e_multiple_finally); - return; + // Handle a ">quit" debug command as if an interrupt had + // occurred before the ":finally". That is, discard the @@ -106,22 +108,8 @@ index 645b27d..0c2dad8 100644 + cleanup_conditionals(cstack, CSF_TRY, FALSE); - if (!skip) -+ /* -+ * Make did_emsg, got_int, did_throw pending. If set, they overrule -+ * a pending ":continue", ":break", ":return", or ":finish". Then -+ * we have particularly to discard a pending return value (as done -+ * by the call to cleanup_conditionals() above when did_emsg or -+ * got_int is set). The pending values are restored by the -+ * ":endtry", except if there is a new error, interrupt, exception, -+ * ":continue", ":break", ":return", or ":finish" in the following -+ * finally clause. A missing ":endwhile", ":endfor" or ":endif" -+ * detected here is treated as if did_emsg and did_throw had -+ * already been set, respectively in case that the error is not -+ * converted to an exception, did_throw had already been unset. -+ * We must not set did_emsg here since that would suppress the -+ * error message. -+ */ -+ if (pending == CSTP_ERROR || did_emsg || got_int || did_throw) ++ if (cstack->cs_idx >= 0 ++ && (cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) { - // When debugging or a breakpoint was encountered, display the - // debug prompt (if not already done). The user then knows that the @@ -144,6 +132,41 @@ index 645b27d..0c2dad8 100644 - * try block or catch clause. - */ - cleanup_conditionals(cstack, CSF_TRY, FALSE); ++ // Variables declared in the previous block can no longer be ++ // used. ++ leave_block(cstack); ++ enter_block(cstack); ++ } + +- if (cstack->cs_idx >= 0 +- && (cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) ++ /* ++ * Make did_emsg, got_int, did_throw pending. If set, they overrule ++ * a pending ":continue", ":break", ":return", or ":finish". Then ++ * we have particularly to discard a pending return value (as done ++ * by the call to cleanup_conditionals() above when did_emsg or ++ * got_int is set). The pending values are restored by the ++ * ":endtry", except if there is a new error, interrupt, exception, ++ * ":continue", ":break", ":return", or ":finish" in the following ++ * finally clause. A missing ":endwhile", ":endfor" or ":endif" ++ * detected here is treated as if did_emsg and did_throw had ++ * already been set, respectively in case that the error is not ++ * converted to an exception, did_throw had already been unset. ++ * We must not set did_emsg here since that would suppress the ++ * error message. ++ */ ++ if (pending == CSTP_ERROR || did_emsg || got_int || did_throw) ++ { ++ if (cstack->cs_pending[cstack->cs_idx] == CSTP_RETURN) + { +- // Variables declared in the previous block can no longer be +- // used. +- leave_block(cstack); +- enter_block(cstack); ++ report_discard_pending(CSTP_RETURN, ++ cstack->cs_rettv[cstack->cs_idx]); ++ discard_pending_return(cstack->cs_rettv[cstack->cs_idx]); + } - - /* - * Make did_emsg, got_int, did_throw pending. If set, they overrule @@ -161,8 +184,7 @@ index 645b27d..0c2dad8 100644 - * error message. - */ - if (pending == CSTP_ERROR || did_emsg || got_int || did_throw) -+ if (cstack->cs_pending[cstack->cs_idx] == CSTP_RETURN) - { +- { - if (cstack->cs_pending[cstack->cs_idx] == CSTP_RETURN) - { - report_discard_pending(CSTP_RETURN, @@ -187,10 +209,7 @@ index 645b27d..0c2dad8 100644 - if (did_throw && cstack->cs_exception[cstack->cs_idx] - != current_exception) - internal_error("ex_finally()"); -+ report_discard_pending(CSTP_RETURN, -+ cstack->cs_rettv[cstack->cs_idx]); -+ discard_pending_return(cstack->cs_rettv[cstack->cs_idx]); - } +- } - - /* - * Set CSL_HAD_FINA, so do_cmdline() will reset did_emsg, @@ -231,12 +250,12 @@ index 645b27d..0c2dad8 100644 } } -@@ -1775,170 +1773,171 @@ ex_endtry(exarg_T *eap) - void *rettv = NULL; - struct condstack *cstack = eap->cstack; +@@ -2076,185 +2075,183 @@ ex_endtry(exarg_T *eap) + if (cmdmod_error(FALSE)) + return; - if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) -- eap->errmsg = N_("E602: :endtry without :try"); +- eap->errmsg = _(e_endtry_without_try); - else + for (idx = cstack->cs_idx; idx >= 0; --idx) + if (cstack->cs_flags[idx] & CSF_TRY) @@ -254,8 +273,8 @@ index 645b27d..0c2dad8 100644 - * made inactive by a ":continue", ":break", ":return", or ":finish" in - * the finally clause. The latter case need not be tested since then - * anything pending has already been discarded. */ -- skip = did_emsg || got_int || did_throw || -+ eap->errmsg = N_("E602: :endtry without :try"); +- skip = did_emsg || got_int || did_throw ++ eap->errmsg = _(e_endtry_without_try); + return; + } + @@ -270,12 +289,16 @@ index 645b27d..0c2dad8 100644 + * made inactive by a ":continue", ":break", ":return", or ":finish" in + * the finally clause. The latter case need not be tested since then + * anything pending has already been discarded. */ -+ skip = did_emsg || got_int || did_throw || - !(cstack->cs_flags[cstack->cs_idx] & CSF_TRUE); ++ skip = did_emsg || got_int || did_throw + || !(cstack->cs_flags[cstack->cs_idx] & CSF_TRUE); - if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) - { - eap->errmsg = get_end_emsg(cstack); ++ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) ++ { ++ eap->errmsg = get_end_emsg(cstack); + - // Find the matching ":try" and report what's missing. - idx = cstack->cs_idx; - do @@ -284,9 +307,10 @@ index 645b27d..0c2dad8 100644 - rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, - &cstack->cs_looplevel); - skip = TRUE; -+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) -+ { -+ eap->errmsg = get_end_emsg(cstack); ++ // Find the matching ":try" and report what's missing. ++ rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, ++ &cstack->cs_looplevel); ++ skip = TRUE; - /* - * If an exception is being thrown, discard it to prevent it from @@ -297,15 +321,40 @@ index 645b27d..0c2dad8 100644 - */ - if (did_throw) - discard_current_exception(); ++ /* ++ * If an exception is being thrown, discard it to prevent it from ++ * being rethrown at the end of this function. It would be ++ * discarded by the error message, anyway. Resets did_throw. ++ * This does not affect the script termination due to the error ++ * since "trylevel" is decremented after emsg() has been called. ++ */ ++ if (did_throw) ++ discard_current_exception(); + +- // report eap->errmsg, also when there already was an error +- did_emsg = FALSE; - } - else - { - idx = cstack->cs_idx; -+ // Find the matching ":try" and report what's missing. -+ rewind_conditionals(cstack, idx, CSF_WHILE | CSF_FOR, -+ &cstack->cs_looplevel); -+ skip = TRUE; ++ // report eap->errmsg, also when there already was an error ++ did_emsg = FALSE; ++ } ++ else ++ { ++ idx = cstack->cs_idx; +- // Check the flags only when not in a skipped block. +- if (!skip && in_vim9script() ++ // Check the flags only when not in a skipped block. ++ if (!skip && in_vim9script() + && (cstack->cs_flags[idx] & (CSF_CATCH|CSF_FINALLY)) == 0) +- { +- // try/endtry without any catch or finally: give an error and +- // continue. +- eap->errmsg = _(e_missing_catch_or_finally); +- } +- - /* - * If we stopped with the exception currently being thrown at this - * try conditional since we didn't know that it doesn't have @@ -316,16 +365,7 @@ index 645b27d..0c2dad8 100644 - && !(cstack->cs_flags[idx] & CSF_FINALLY)) - rethrow = TRUE; - } -+ /* -+ * If an exception is being thrown, discard it to prevent it from -+ * being rethrown at the end of this function. It would be -+ * discarded by the error message, anyway. Resets did_throw. -+ * This does not affect the script termination due to the error -+ * since "trylevel" is decremented after emsg() has been called. -+ */ -+ if (did_throw) -+ discard_current_exception(); - +- - // If there was no finally clause, show the user when debugging or - // a breakpoint was encountered that the end of the try conditional has - // been reached: display the debug prompt (if not already done). Do @@ -337,7 +377,7 @@ index 645b27d..0c2dad8 100644 - && !(cstack->cs_flags[idx] & CSF_FINALLY) - && !cstack->cs_pending[idx])) - && dbg_check_skipped(eap)) -- { + { - // Handle a ">quit" debug command as if an interrupt had occurred - // before the ":endtry". That is, throw an interrupt exception and - // set "skip" and "rethrow". @@ -351,11 +391,10 @@ index 645b27d..0c2dad8 100644 - if (did_throw && !(cstack->cs_flags[idx] & CSF_FINALLY)) - rethrow = TRUE; - } -- } -+ } -+ else -+ { -+ idx = cstack->cs_idx; ++ // try/endtry without any catch or finally: give an error and ++ // continue. ++ eap->errmsg = _(e_missing_catch_or_finally); + } /* - * If a ":return" is pending, we need to resume it after closing the @@ -432,7 +471,9 @@ index 645b27d..0c2dad8 100644 + current_exception = cstack->cs_exception[idx]; + } -- --cstack->cs_idx; +- if (cstack->cs_idx >= 0 +- && (cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) +- leave_block(cstack); - --cstack->cs_trylevel; + /* + * Discard anything pending on an error, interrupt, or throw in the @@ -449,7 +490,8 @@ index 645b27d..0c2dad8 100644 - if (!skip) - { - report_resume_pending(pending, -+ --cstack->cs_idx; ++ if (cstack->cs_idx >= 0 && (cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) ++ leave_block(cstack); + --cstack->cs_trylevel; + + if (!skip) @@ -547,6 +589,46 @@ index 645b27d..0c2dad8 100644 } /* +diff --git a/src/testdir/test_trycatch.vim b/src/testdir/test_trycatch.vim +index aa42205a1..28cd39f04 100644 +--- a/src/testdir/test_trycatch.vim ++++ b/src/testdir/test_trycatch.vim +@@ -3,6 +3,7 @@ + + source check.vim + source shared.vim ++import './vim9.vim' as v9 + + "------------------------------------------------------------------------------- + " Test environment {{{1 +@@ -2008,6 +2009,27 @@ func Test_try_catch_errors() + call assert_fails('try | for i in range(5) | endif | endtry', 'E580:') + call assert_fails('try | while v:true | endtry', 'E170:') + call assert_fails('try | if v:true | endtry', 'E171:') ++ ++ " this was using a negative index in cstack[] ++ let lines =<< trim END ++ try ++ for ++ if ++ endwhile ++ if ++ finally ++ END ++ call v9.CheckScriptFailure(lines, 'E690:') ++ ++ let lines =<< trim END ++ try ++ for ++ if ++ endwhile ++ if ++ endtry ++ END ++ call v9.CheckScriptFailure(lines, 'E690:') + endfunc + + " Test for verbose messages with :try :catch, and :finally {{{1 -- -2.33.0 +2.23.0 diff --git a/backport-CVE-2022-3297.patch b/backport-CVE-2022-3297.patch index 41f16f18c7f9a77756b6ec78882eebb893e9a6e7..c80ef133376b775a608a5700dbb0c4321521e77c 100644 --- a/backport-CVE-2022-3297.patch +++ b/backport-CVE-2022-3297.patch @@ -8,16 +8,16 @@ Problem: Using freed memory when 'tagfunc' wipes out buffer that holds 'complete'. Solution: Make a copy of the option. Make sure cursor position is valid. --- - src/insexpand.c | 39 +++++++++++++++++++++++++++---- + src/insexpand.c | 40 ++++++++++++++++++++++++------- src/move.c | 1 + - src/testdir/test_ins_complete.vim | 16 +++++++++++++ - 3 files changed, 51 insertions(+), 5 deletions(-) + src/testdir/test_ins_complete.vim | 20 ++++++++++++++-- + 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/insexpand.c b/src/insexpand.c -index a23d2d6..647297d 100644 +index 24308e6..3585ef2 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -2210,7 +2210,8 @@ ins_compl_next_buf(buf_T *buf, int flag) +@@ -2485,7 +2485,8 @@ ins_compl_next_buf(buf_T *buf, int flag) if (flag == 'w') // just windows { @@ -27,80 +27,92 @@ index a23d2d6..647297d 100644 wp = curwin; while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin && wp->w_buffer->b_scanned) -@@ -2672,6 +2673,7 @@ ins_compl_get_exp(pos_T *ini) - static pos_T first_match_pos; - static pos_T last_match_pos; - static char_u *e_cpt = (char_u *)""; // curr. entry in 'complete' -+ static char_u *e_cpt_copy = (char_u *)""; // copy of 'complete' - static int found_all = FALSE; // Found all matches of a - // certain type. - static buf_T *ins_buf = NULL; // buffer being scanned -@@ -2690,15 +2692,34 @@ ins_compl_get_exp(pos_T *ini) - char_u *dict = NULL; - int dict_f = 0; - int set_match_pos; +@@ -3188,9 +3189,10 @@ enum + */ + typedef struct + { +- char_u *e_cpt; // current entry in 'complete' ++ char_u *e_cpt_copy; // copy of 'complete' ++ char_u *e_cpt; // current entry in "e_cpt_copy" + buf_T *ins_buf; // buffer being scanned +- pos_T *cur_match_pos; // current match position ++ pos_T *cur_match_pos; // current match position + pos_T prev_match_pos; // previous match position + int set_match_pos; // save first_match_pos/last_match_pos + pos_T first_match_pos; // first match position +@@ -3257,7 +3259,8 @@ process_next_cpt_value( + st->set_match_pos = TRUE; + } + else if (vim_strchr((char_u *)"buwU", *st->e_cpt) != NULL +- && (st->ins_buf = ins_compl_next_buf(st->ins_buf, *st->e_cpt)) != curbuf) ++ && (st->ins_buf = ins_compl_next_buf( ++ st->ins_buf, *st->e_cpt)) != curbuf) + { + // Scan a buffer, but not the current one. + if (st->ins_buf->b_ml.ml_mfp != NULL) // loaded buffer +@@ -3756,19 +3759,30 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) + static int + ins_compl_get_exp(pos_T *ini) + { +- static ins_compl_next_state_T st; ++ static ins_compl_next_state_T st; + static int st_cleared = FALSE; + int i; + int found_new_match; + int type = ctrl_x_mode; if (!compl_started) { -- FOR_ALL_BUFFERS(ins_buf) -- ins_buf->b_scanned = 0; +- FOR_ALL_BUFFERS(st.ins_buf) +- st.ins_buf->b_scanned = 0; + buf_T *buf; + + FOR_ALL_BUFFERS(buf) + buf->b_scanned = 0; + if (!st_cleared) + { -+ e_cpt = NULL; -+ e_cpt_copy = NULL; -+ ins_buf = NULL; -+ set_match_pos = 0; -+ vim_memset(&first_match_pos, 0, sizeof(first_match_pos)); -+ vim_memset(&last_match_pos, 0, sizeof(last_match_pos)); -+ found_all = FALSE; -+ dict = NULL; -+ dict_f = 0; -+ st_cleared = TRUE; ++ CLEAR_FIELD(st); ++ st_cleared = TRUE; + } - found_all = FALSE; - ins_buf = curbuf; -- e_cpt = (compl_cont_status & CONT_LOCAL) + st.found_all = FALSE; + st.ins_buf = curbuf; +- st.e_cpt = (compl_cont_status & CONT_LOCAL) - ? (char_u *)"." : curbuf->b_p_cpt; -+ vim_free(e_cpt_copy); ++ vim_free(st.e_cpt_copy); + // Make a copy of 'complete', if case the buffer is wiped out. -+ e_cpt_copy = vim_strsave((compl_cont_status & CONT_LOCAL) ++ st.e_cpt_copy = vim_strsave((compl_cont_status & CONT_LOCAL) + ? (char_u *)"." : curbuf->b_p_cpt); -+ e_cpt = e_cpt_copy == NULL ? (char_u *)"" : e_cpt_copy; - last_match_pos = first_match_pos = *ini; ++ st.e_cpt = st.e_cpt_copy == NULL ? (char_u *)"" : st.e_cpt_copy; + st.last_match_pos = st.first_match_pos = *ini; } - else if (ins_buf != curbuf && !buf_valid(ins_buf)) -@@ -3204,6 +3225,7 @@ ins_compl_next( - int found_end = FALSE; + else if (st.ins_buf != curbuf && !buf_valid(st.ins_buf)) +@@ -4112,6 +4126,7 @@ ins_compl_next( + int todo = count; int advance; int started = compl_started; + buf_T *orig_curbuf = curbuf; // When user complete function return -1 for findstart which is next // time of 'always', compl_shown_match become NULL. -@@ -3336,6 +3358,13 @@ ins_compl_next( - } - } +@@ -4144,6 +4159,13 @@ ins_compl_next( + &num_matches) == -1) + return -1; -+ if (curbuf != orig_curbuf) -+ { ++ if (curbuf != orig_curbuf) ++ { + // In case some completion function switched buffer, don't want to + // insert the completion elsewhere. + return -1; -+ } ++ } + // Insert the text of the new completion, or the compl_leader. if (compl_no_insert && !started) { diff --git a/src/move.c b/src/move.c -index 10165ef..1d7bcfb 100644 +index b061a75..6c654ac 100644 --- a/src/move.c +++ b/src/move.c -@@ -637,6 +637,7 @@ cursor_valid(void) +@@ -652,6 +652,7 @@ cursor_valid(void) void validate_cursor(void) { @@ -109,14 +121,24 @@ index 10165ef..1d7bcfb 100644 if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW)) curs_columns(TRUE); diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim -index 39ece18..1b53987 100644 +index b303993..702a87c 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim -@@ -427,3 +427,19 @@ func Test_ins_complete_end_of_line() +@@ -628,9 +628,8 @@ func Test_pum_with_preview_win() + call writefile(lines, 'Xpreviewscript') + let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12}) +- call TermWait(buf, 50) + call term_sendkeys(buf, "Gi\\") +- call TermWait(buf, 100) ++ call TermWait(buf, 200) + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {}) + +@@ -2233,4 +2232,21 @@ func Test_ins_complete_end_of_line() bwipe! endfunc -+ + +func s:Tagfunc(t,f,o) + bwipe! + return [] @@ -132,6 +154,9 @@ index 39ece18..1b53987 100644 + + bwipe! +endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab -- -2.33.0 +2.27.0 diff --git a/backport-CVE-2022-3324.patch b/backport-CVE-2022-3324.patch index cd6bf282a1fb6914f33ad2b84c2e275e177e3a19..0c49cf479e8cf6c451db30828f0aed1dc1bdc7ae 100644 --- a/backport-CVE-2022-3324.patch +++ b/backport-CVE-2022-3324.patch @@ -12,10 +12,10 @@ Solution: Make sure the window width does not become negative. 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index aceaba7..f24b059 100644 +index 440df96..ab3bfdf 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim -@@ -953,4 +953,26 @@ func Test_cmdwin_freed_buffer_ptr() +@@ -3457,4 +3457,26 @@ func Test_cmdwin_freed_buffer_ptr() bwipe! endfunc @@ -43,10 +43,10 @@ index aceaba7..f24b059 100644 + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/window.c b/src/window.c -index e0df540..42e2742 100644 +index c91ebbc..73060db 100644 --- a/src/window.c +++ b/src/window.c -@@ -2045,6 +2045,8 @@ win_equal_rec( +@@ -2087,6 +2087,8 @@ win_equal_rec( if (hnc) // add next_curwin size { next_curwin_size -= p_wiw - (m - n); @@ -55,7 +55,7 @@ index e0df540..42e2742 100644 new_size += next_curwin_size; room -= new_size - next_curwin_size; } -@@ -6180,7 +6182,8 @@ scroll_to_fraction(win_T *wp, int prev_height) +@@ -6495,7 +6497,8 @@ scroll_to_fraction(win_T *wp, int prev_height) void win_new_width(win_T *wp, int width) { diff --git a/backport-CVE-2022-3352.patch b/backport-CVE-2022-3352.patch index 3203c86021704568e5ffeabf807ec809f0e339b6..5c92cc08b1c40f715841ddcdae9c98b9e6a24d7a 100644 --- a/backport-CVE-2022-3352.patch +++ b/backport-CVE-2022-3352.patch @@ -6,34 +6,34 @@ Subject: [PATCH] patch 9.0.0614: SpellFileMissing autocmd may delete buffer Problem: SpellFileMissing autocmd may delete buffer. Solution: Disallow deleting the current buffer to avoid using freed memory. --- - src/buffer.c | 6 +++++- + src/buffer.c | 7 ++++++- src/spell.c | 6 ++++++ - src/testdir/test_autocmd.vim | 11 +++++++++++ + src/testdir/test_autocmd.vim | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c -index f66c234..b647d82 100644 +index e775398..a85b2a8 100644 --- a/src/buffer.c +++ b/src/buffer.c -@@ -465,8 +465,12 @@ can_unload_buffer(buf_T *buf) +@@ -461,7 +461,12 @@ can_unload_buffer(buf_T *buf) } } if (!can_unload) +- semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), buf->b_fname); + { + char_u *fname = buf->b_fname != NULL ? buf->b_fname : buf->b_ffname; + - semsg(_("E937: Attempt to delete a buffer that is in use: %s"), -- buf->b_fname); ++ semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), + fname != NULL ? fname : (char_u *)"[No Name]"); + } return can_unload; } diff --git a/src/spell.c b/src/spell.c -index 1d7a1ae..e32dbe7 100644 +index 24abce4..3664425 100644 --- a/src/spell.c +++ b/src/spell.c -@@ -1539,6 +1539,10 @@ spell_load_lang(char_u *lang) +@@ -1559,6 +1559,10 @@ spell_load_lang(char_u *lang) sl.sl_slang = NULL; sl.sl_nobreak = FALSE; @@ -44,7 +44,7 @@ index 1d7a1ae..e32dbe7 100644 // We may retry when no spell file is found for the language, an // autocommand may load it then. for (round = 1; round <= 2; ++round) -@@ -1592,6 +1596,8 @@ spell_load_lang(char_u *lang) +@@ -1612,6 +1616,8 @@ spell_load_lang(char_u *lang) STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl"); do_in_runtimepath(fname_enc, DIP_ALL, spell_load_cb, &sl); } @@ -54,14 +54,13 @@ index 1d7a1ae..e32dbe7 100644 /* diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim -index 27ec80d..e7ffc37 100755 +index e9a59c2..bc74c29 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim -@@ -2343,3 +2343,14 @@ func Test_BufWrite_lockmarks() - call delete('Xtest') - call delete('Xtest2') +@@ -2750,6 +2750,16 @@ func Test_FileType_spell() + setglobal spellfile= endfunc -+ + +" this was wiping out the current buffer and using freed memory +func Test_SpellFileMissing_bwipe() + next 0 @@ -72,6 +71,9 @@ index 27ec80d..e7ffc37 100755 + bwipe +endfunc + + " Test closing a window or editing another buffer from a FileChangedRO handler + " in a readonly buffer + func Test_FileChangedRO_winclose() -- 2.27.0 diff --git a/backport-CVE-2022-3705.patch b/backport-CVE-2022-3705.patch index 0b78b7279e22007a39337a905b51a79f23c5356c..b93c74cee47e4ea066b51ba4d740374a2fa47f04 100644 --- a/backport-CVE-2022-3705.patch +++ b/backport-CVE-2022-3705.patch @@ -8,16 +8,16 @@ Problem: Filetype autocmd may cause freed memory access. Solution: Set the quickfix-busy flag while filling the buffer. --- src/quickfix.c | 6 ++++++ - src/testdir/test_quickfix.vim | 15 +++++++++++++++ - 2 files changed, 21 insertions(+) + src/testdir/test_quickfix.vim | 16 ++++++++++++++++ + 2 files changed, 22 insertions(+) diff --git a/src/quickfix.c b/src/quickfix.c index a90611475ab1..f85fff56f23d 100644 --- a/src/quickfix.c +++ b/src/quickfix.c -@@ -4420,6 +4420,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) - { - linenr_T old_line_count = buf->b_ml.ml_line_count; +@@ -4543,6 +4543,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) + qf_winid = win->w_id; + } + // autocommands may cause trouble + incr_quickfix_busy(); @@ -25,7 +25,7 @@ index a90611475ab1..f85fff56f23d 100644 if (old_last == NULL) // set curwin/curbuf to buf and save a few things aucmd_prepbuf(&aco, buf); -@@ -4441,6 +4444,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) +@@ -4564,6 +4567,9 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last) // when the added lines are not visible. if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline) redraw_buf_later(buf, NOT_VALID); @@ -39,8 +39,8 @@ diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 2ee754b39690..bcaef5da175c 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim -@@ -4756,4 +4756,19 @@ func Test_lopen_bwipe() - delfunc R +@@ -3471,6 +3471,21 @@ func Test_resize_from_copen() + endtry endfunc +func Test_filetype_autocmd() @@ -57,6 +57,14 @@ index 2ee754b39690..bcaef5da175c 100644 + au! FileType + augroup END +endfunc ++ + func Test_vimgrep_with_textlock() + new + +@@ -6380,4 +6395,5 @@ func Test_loclist_replace_autocmd() + call setloclist(0, [], 'f') + endfunc + + " vim: shiftwidth=2 sts=2 expandtab -- diff --git a/backport-add-the-arglist_locked-flag.patch b/backport-add-the-arglist_locked-flag.patch deleted file mode 100644 index 0560c1123119da695c11b9ae94b2adb56ed6dc16..0000000000000000000000000000000000000000 --- a/backport-add-the-arglist_locked-flag.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 5ed58c7b700fcb9fd03c418300145b616f4bdcdd Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 28 Jan 2021 14:24:55 +0100 -Subject: [PATCH] patch 8.2.2421: double free when using autocommand with - "argdel" -Conflict:NA -Reference:https://github.com/vim/vim/commit/5ed58c7b700fcb9fd03c418300145b616f4bdcdd - -Problem: Double free when using autocommand with "argdel". (Houyunsong) -Solution: Add the arglist_locked flag. - ---- - src/arglist.c | 47 +++++++++++++++++++++++++++++------- - src/testdir/test_autocmd.vim | 6 +++++ - 2 files changed, 44 insertions(+), 9 deletions(-) - -diff --git a/src/arglist.c b/src/arglist.c -index cab74f8..68befa4 100644 ---- a/src/arglist.c -+++ b/src/arglist.c -@@ -17,12 +17,29 @@ - #define AL_ADD 2 - #define AL_DEL 3 - -+// This flag is set whenever the argument list is being changed and calling a -+// function that might trigger an autocommand. -+static int arglist_locked = FALSE; -+ -+ static int -+check_arglist_locked(void) -+{ -+ if (arglist_locked) -+ { -+ emsg(_(e_cannot_change_arglist_recursively)); -+ return FAIL; -+ } -+ return OK; -+} -+ - /* - * Clear an argument list: free all file names and reset it to zero entries. - */ - void - alist_clear(alist_T *al) - { -+ if (check_arglist_locked() == FAIL) -+ return; - while (--al->al_ga.ga_len >= 0) - vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname); - ga_clear(&al->al_ga); -@@ -126,14 +143,9 @@ alist_set( - int fnum_len) - { - int i; -- static int recursive = 0; - -- if (recursive) -- { -- emsg(_(e_au_recursive)); -+ if (check_arglist_locked() == FAIL) - return; -- } -- ++recursive; - - alist_clear(al); - if (ga_grow(&al->al_ga, count) == OK) -@@ -152,7 +164,11 @@ alist_set( - // May set buffer name of a buffer previously used for the - // argument list, so that it's re-used by alist_add. - if (fnum_list != NULL && i < fnum_len) -+ { -+ arglist_locked = TRUE; - buf_set_name(fnum_list[i], files[i]); -+ arglist_locked = FALSE; -+ } - - alist_add(al, files[i], use_curbuf ? 2 : 1); - ui_breakcheck(); -@@ -163,8 +179,6 @@ alist_set( - FreeWild(count, files); - if (al == &global_alist) - arg_had_last = FALSE; -- -- --recursive; - } - - /* -@@ -179,6 +193,10 @@ alist_add( - { - if (fname == NULL) // don't add NULL file names - return; -+ if (check_arglist_locked() == FAIL) -+ return; -+ arglist_locked = TRUE; -+ - #ifdef BACKSLASH_IN_FILENAME - slash_adjust(fname); - #endif -@@ -187,6 +205,8 @@ alist_add( - AARGLIST(al)[al->al_ga.ga_len].ae_fnum = - buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0)); - ++al->al_ga.ga_len; -+ -+ arglist_locked = FALSE; - } - - #if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) -@@ -334,7 +354,8 @@ alist_add_list( - int i; - int old_argcount = ARGCOUNT; - -- if (ga_grow(&ALIST(curwin)->al_ga, count) == OK) -+ if (check_arglist_locked() != FAIL -+ && ga_grow(&ALIST(curwin)->al_ga, count) == OK) - { - if (after < 0) - after = 0; -@@ -343,6 +364,7 @@ alist_add_list( - if (after < ARGCOUNT) - mch_memmove(&(ARGLIST[after + count]), &(ARGLIST[after]), - (ARGCOUNT - after) * sizeof(aentry_T)); -+ arglist_locked = TRUE; - for (i = 0; i < count; ++i) - { - int flags = BLN_LISTED | (will_edit ? BLN_CURBUF : 0); -@@ -350,6 +372,7 @@ alist_add_list( - ARGLIST[after + i].ae_fname = files[i]; - ARGLIST[after + i].ae_fnum = buflist_add(files[i], flags); - } -+ arglist_locked = FALSE; - ALIST(curwin)->al_ga.ga_len += count; - if (old_argcount > 0 && curwin->w_arg_idx >= after) - curwin->w_arg_idx += count; -@@ -382,6 +405,9 @@ do_arglist( - int match; - int arg_escaped = TRUE; - -+ if (check_arglist_locked() == FAIL) -+ return FAIL; -+ - // Set default argument for ":argadd" command. - if (what == AL_ADD && *str == NUL) - { -@@ -776,6 +802,9 @@ ex_argdelete(exarg_T *eap) - int i; - int n; - -+ if (check_arglist_locked() == FAIL) -+ return; -+ - if (eap->addr_count > 0 || *eap->arg == NUL) - { - // ":argdel" works like ":argdel" -diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim -index ab02402..4fa3b51 100755 ---- a/src/testdir/test_autocmd.vim -+++ b/src/testdir/test_autocmd.vim -@@ -147,6 +147,12 @@ func Test_autocmd_bufunload_with_tabnext() - quit - endfunc - -+func Test_argdelete_in_next() -+ au BufNew,BufEnter,BufLeave,BufWinEnter * argdel -+ call assert_fails('next a b', 'E1156:') -+ au! BufNew,BufEnter,BufLeave,BufWinEnter * -+endfunc -+ - func Test_autocmd_bufwinleave_with_tabfirst() - tabedit - augroup sample --- -2.27.0 - diff --git a/backport-after-a-put-the-mark-is-on-the-last-byte.patch b/backport-after-a-put-the-mark-is-on-the-last-byte.patch deleted file mode 100644 index 3fb062966ee5342aa283afaae33d68eedf815fbe..0000000000000000000000000000000000000000 --- a/backport-after-a-put-the-mark-is-on-the-last-byte.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 4d07253a485819b3a9fd923d263e722ea2109c12 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 25 Nov 2021 19:31:15 +0000 -Subject: [PATCH] patch 8.2.3677: after a put the '] mark is on the last byte - -Problem: After a put the '] mark is on the last byte of a multi-byte - character. -Solution: Move it to the first byte. (closes #9047) ---- - src/register.c | 18 +++++++++++++++--- - src/testdir/test_put.vim | 13 +++++++++++++ - 2 files changed, 28 insertions(+), 3 deletions(-) - -diff --git a/src/register.c b/src/register.c -index d5eb011..49f4079 100644 ---- a/src/register.c -+++ b/src/register.c -@@ -1479,6 +1479,7 @@ do_put( - long cnt; - pos_T orig_start = curbuf->b_op_start; - pos_T orig_end = curbuf->b_op_end; -+ int first_byte_off = 0; - - #ifdef FEAT_CLIPBOARD - // Adjust register name for "unnamed" in 'clipboard'. -@@ -1936,6 +1937,10 @@ do_put( - } - STRMOVE(ptr, oldp + col); - ml_replace(lnum, newp, FALSE); -+ -+ // compute the byte offset for the last character -+ first_byte_off = mb_head_off(newp, ptr - 1); -+ - // Place cursor on last putted char. - if (lnum == curwin->w_cursor.lnum) - { -@@ -1951,10 +1956,15 @@ do_put( - if (VIsual_active) // reset lnum to the last visual line - lnum--; - -+ // put '] at the first byte of the last character - curbuf->b_op_end = curwin->w_cursor; -+ curbuf->b_op_end.col -= first_byte_off; -+ - // For "CTRL-O p" in Insert mode, put cursor after last char - if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND))) - ++curwin->w_cursor.col; -+ else -+ curwin->w_cursor.col -= first_byte_off; - changed_bytes(lnum, col); - } - else -@@ -2061,12 +2071,14 @@ error: - changed_lines(curbuf->b_op_start.lnum, 0, - curbuf->b_op_start.lnum, nr_lines); - -- // put '] mark at last inserted character -+ // Put the '] mark on the first byte of the last inserted character. -+ // Correct the length for change in indent. - curbuf->b_op_end.lnum = lnum; -- // correct length for change in indent - col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff; - if (col > 1) -- curbuf->b_op_end.col = col - 1; -+ curbuf->b_op_end.col = col - 1 -+ - mb_head_off(y_array[y_size - 1], -+ y_array[y_size - 1] + col - 1); - else - curbuf->b_op_end.col = 0; - -diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim -index 42bb7e6..07f6387 100644 ---- a/src/testdir/test_put.vim -+++ b/src/testdir/test_put.vim -@@ -130,3 +130,16 @@ func Test_very_larg_count() - bwipe! - endfunc - -+func Test_multibyte_op_end_mark() -+ new -+ call setline(1, 'теÑÑ‚') -+ normal viwdp -+ call assert_equal([0, 1, 7, 0], getpos("'>")) -+ call assert_equal([0, 1, 7, 0], getpos("']")) -+ -+ normal Vyp -+ call assert_equal([0, 1, 2147483647, 0], getpos("'>")) -+ call assert_equal([0, 2, 7, 0], getpos("']")) -+ bwipe! -+endfunc -+ --- -1.8.3.1 - diff --git a/backport-block-insert-with-double-wide-character-fails.patch b/backport-block-insert-with-double-wide-character-fails.patch deleted file mode 100644 index b04e34239744d4675fad17764a8fe1c1cc877ffb..0000000000000000000000000000000000000000 --- a/backport-block-insert-with-double-wide-character-fails.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fc6ccebea668c49e9e617e0657421b6a8ed9df1e Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 20 Jan 2022 12:22:35 +0000 -Subject: [PATCH] patch 8.2.4152: block insert with double wide character fails -Problem: Block insert with double wide character fails. -Solution: Adjust the expected output. -Reference:https://github.com/vim/vim/commit/fc6ccebea668c49e9e617e0657421b6a8ed9df1e -Conflict:Conflict:The src/version.c file is not modified. ---- - src/testdir/test_utf8.vim | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim -index 42a46fd..32cec0f 100644 ---- a/src/testdir/test_utf8.vim -+++ b/src/testdir/test_utf8.vim -@@ -7,7 +7,7 @@ func Test_visual_block_insert() - new - call setline(1, ["aaa", "ã‚ã‚ã‚", "bbb"]) - exe ":norm! gg0l\jjIx\" -- call assert_equal(['axaa', 'xã‚ã‚ã‚', 'bxbb'], getline(1, '$')) -+ call assert_equal(['axaa', ' xã‚ã‚ã‚', 'bxbb'], getline(1, '$')) - bwipeout! - endfunc - --- -2.27.0 diff --git a/backport-bracketed-paste-can-still-cause-invalid-memory-acces.patch b/backport-bracketed-paste-can-still-cause-invalid-memory-acces.patch deleted file mode 100644 index 193e9891908fb1b330f96644bddd3935ebcf4879..0000000000000000000000000000000000000000 --- a/backport-bracketed-paste-can-still-cause-invalid-memory-acces.patch +++ /dev/null @@ -1,42 +0,0 @@ -From fe4bbac1166f2e4e3fa18cb966ec7305198c8176 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 20 Jan 2020 21:12:20 +0100 -Subject: [PATCH] patch 8.2.0135: bracketed paste can still cause invalid - memory access -Problem: Bracketed paste can still cause invalid memory access. (Dominique - Pelle) -Solution: Check for NULL pointer. -Reference:https://github.com/vim/vim/commit/fe4bbac1166f2e4e3fa18cb966ec7305198c8176 -Conflict:The src/version.c file is not modified. ---- - src/edit.c | 2 +- - src/testdir/test_search.vim | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) -diff --git a/src/edit.c b/src/edit.c -index f822a79..1b7d368 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -4942,7 +4942,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) - int save_paste = p_paste; - - // If the end code is too long we can't detect it, read everything. -- if (STRLEN(end) >= NUMBUFLEN) -+ if (end != NULL && STRLEN(end) >= NUMBUFLEN) - end = NULL; - ++no_mapping; - allow_keys = 0; -diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim -index c8020eb..4bf0b2d 100644 ---- a/src/testdir/test_search.vim -+++ b/src/testdir/test_search.vim -@@ -1368,6 +1368,7 @@ func Test_searchdecl() - endfunc - - func Test_search_special() -- " this was causing illegal memory access -+ " this was causing illegal memory access and an endless loop -+ set t_PE= - exe "norm /\x80PS" - endfunc --- -2.27.0 diff --git a/backport-cannot-list-options-one-per-line.patch b/backport-cannot-list-options-one-per-line.patch deleted file mode 100644 index e1caaab9c42051e8929b4f1f77fb29c0f284c30a..0000000000000000000000000000000000000000 --- a/backport-cannot-list-options-one-per-line.patch +++ /dev/null @@ -1,274 +0,0 @@ -From 6b915c0c0ee7ef82f8d3d310a4345e098cb929b0 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 18 Jan 2020 15:53:19 +0100 -Subject: [PATCH] patch 8.2.0128: cannot list options one per line - -Problem: Cannot list options one per line. -Solution: Use ":set!" to list one option per line. ---- - runtime/doc/options.txt | 12 ++++++++---- - src/ex_cmds.h | 6 +++--- - src/ex_docmd.c | 18 ------------------ - src/option.c | 34 +++++++++++++++++++++++++++++----- - src/optiondefs.h | 2 +- - src/proto/option.pro | 1 + - src/testdir/test_options.vim | 9 ++++++++- - src/vim.h | 13 +++++++------ - 8 files changed, 57 insertions(+), 38 deletions(-) - -diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt -index 2fced50..8f11253 100644 ---- a/runtime/doc/options.txt -+++ b/runtime/doc/options.txt -@@ -22,9 +22,13 @@ achieve special effects. These options come in three forms: - 1. Setting options *set-option* *E764* - - *:se* *:set* --:se[t] Show all options that differ from their default value. -+:se[t][!] Show all options that differ from their default value. -+ When [!] is present every option is on a separate -+ line. - --:se[t] all Show all but terminal options. -+:se[t][!] all Show all but terminal options. -+ When [!] is present every option is on a separate -+ line. - - :se[t] termcap Show all terminal options. Note that in the GUI the - key codes are not shown, because they are generated -@@ -287,7 +291,7 @@ happens when the buffer is not loaded, but they are lost when the buffer is - wiped out |:bwipe|. - - *:setl* *:setlocal* --:setl[ocal] ... Like ":set" but set only the value local to the -+:setl[ocal][!] ... Like ":set" but set only the value local to the - current buffer or window. Not all options have a - local value. If the option does not have a local - value the global value is set. -@@ -309,7 +313,7 @@ wiped out |:bwipe|. - {option}, so that the global value will be used. - - *:setg* *:setglobal* --:setg[lobal] ... Like ":set" but set only the global value for a local -+:setg[lobal][!] ... Like ":set" but set only the global value for a local - option without changing the local value. - When displaying an option, the global value is shown. - With the "all" argument: display global values for all -diff --git a/src/ex_cmds.h b/src/ex_cmds.h -index 28ea6ee..605766a 100644 ---- a/src/ex_cmds.h -+++ b/src/ex_cmds.h -@@ -1307,16 +1307,16 @@ EXCMD(CMD_scscope, "scscope", ex_scscope, - EX_EXTRA|EX_NOTRLCOM, - ADDR_NONE), - EXCMD(CMD_set, "set", ex_set, -- EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, -+ EX_BANG|EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, - ADDR_NONE), - EXCMD(CMD_setfiletype, "setfiletype", ex_setfiletype, - EX_TRLBAR|EX_EXTRA|EX_NEEDARG|EX_CMDWIN, - ADDR_NONE), - EXCMD(CMD_setglobal, "setglobal", ex_set, -- EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, -+ EX_BANG|EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, - ADDR_NONE), - EXCMD(CMD_setlocal, "setlocal", ex_set, -- EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, -+ EX_BANG|EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, - ADDR_NONE), - EXCMD(CMD_sfind, "sfind", ex_splitview, - EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG, -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index b552440..1644573 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -320,7 +320,6 @@ static void ex_setfiletype(exarg_T *eap); - # define ex_diffupdate ex_ni - #endif - static void ex_digraphs(exarg_T *eap); --static void ex_set(exarg_T *eap); - #ifdef FEAT_SEARCH_EXTRA - static void ex_nohlsearch(exarg_T *eap); - #else -@@ -8499,23 +8498,6 @@ ex_digraphs(exarg_T *eap UNUSED) - #endif - } - -- static void --ex_set(exarg_T *eap) --{ -- int flags = 0; -- -- if (eap->cmdidx == CMD_setlocal) -- flags = OPT_LOCAL; -- else if (eap->cmdidx == CMD_setglobal) -- flags = OPT_GLOBAL; --#if defined(FEAT_EVAL) && defined(FEAT_BROWSE) -- if (cmdmod.browse && flags == 0) -- ex_options(eap); -- else --#endif -- (void)do_set(eap->arg, flags); --} -- - #if defined(FEAT_SEARCH_EXTRA) || defined(PROTO) - void - set_no_hlsearch(int flag) -diff --git a/src/option.c b/src/option.c -index 382b01b..eb610dd 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -1066,6 +1066,27 @@ set_title_defaults(void) - } - #endif - -+ void -+ex_set(exarg_T *eap) -+{ -+ int flags = 0; -+ -+ if (eap->cmdidx == CMD_setlocal) -+ flags = OPT_LOCAL; -+ else if (eap->cmdidx == CMD_setglobal) -+ flags = OPT_GLOBAL; -+#if defined(FEAT_EVAL) && defined(FEAT_BROWSE) -+ if (cmdmod.browse && flags == 0) -+ ex_options(eap); -+ else -+#endif -+ { -+ if (eap->forceit) -+ flags |= OPT_ONECOLUMN; -+ (void)do_set(eap->arg, flags); -+ } -+} -+ - /* - * Parse 'arg' for option settings. - * -@@ -4354,7 +4375,7 @@ showoptions( - #define INC 20 - #define GAP 3 - -- items = ALLOC_MULT(struct vimoption *, PARAM_COUNT); -+ items = ALLOC_MULT(struct vimoption *, OPTION_COUNT); - if (items == NULL) - return; - -@@ -4369,9 +4390,10 @@ showoptions( - msg_puts_title(_("\n--- Options ---")); - - /* -- * do the loop two times: -+ * Do the loop two times: - * 1. display the short items - * 2. display the long items (only strings and numbers) -+ * When "opt_flags" has OPT_ONECOLUMN do everything in run 2. - */ - for (run = 1; run <= 2 && !got_int; ++run) - { -@@ -4382,12 +4404,12 @@ showoptions( - for (p = &options[0]; p->fullname != NULL; p++) - { - // apply :filter /pat/ -- if (message_filtered((char_u *) p->fullname)) -+ if (message_filtered((char_u *)p->fullname)) - continue; - - varp = NULL; - isterm = istermoption(p); -- if (opt_flags != 0) -+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) != 0) - { - if (p->indir != PV_NONE && !isterm) - varp = get_varp_scope(p, opt_flags); -@@ -4399,7 +4421,9 @@ showoptions( - || (all == 1 && !isterm) - || (all == 0 && !optval_default(p, varp, p_cp)))) - { -- if (p->flags & P_BOOL) -+ if (opt_flags & OPT_ONECOLUMN) -+ len = Columns; -+ else if (p->flags & P_BOOL) - len = 1; // a toggle option fits always - else - { -diff --git a/src/optiondefs.h b/src/optiondefs.h -index 8fda8bf..3670107 100644 ---- a/src/optiondefs.h -+++ b/src/optiondefs.h -@@ -3009,7 +3009,7 @@ static struct vimoption options[] = - {NULL, NULL, 0, NULL, PV_NONE, {NULL, NULL} SCTX_INIT} - }; - --#define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption)) -+#define OPTION_COUNT (sizeof(options) / sizeof(struct vimoption)) - - // The following is needed to make the gen_opt_test.vim script work. - // {" -diff --git a/src/proto/option.pro b/src/proto/option.pro -index dc07ee6..7da2cbf 100644 ---- a/src/proto/option.pro -+++ b/src/proto/option.pro -@@ -8,6 +8,7 @@ void set_init_2(void); - void set_init_3(void); - void set_helplang_default(char_u *lang); - void set_title_defaults(void); -+void ex_set(exarg_T *eap); - int do_set(char_u *arg, int opt_flags); - void did_set_option(int opt_idx, int opt_flags, int new_value, int value_checked); - int string_to_key(char_u *arg, int multi_byte); -diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim -index d4213c1..7584465 100644 ---- a/src/testdir/test_options.vim -+++ b/src/testdir/test_options.vim -@@ -44,7 +44,7 @@ func Test_wildchar() - set wildchar& - endfunc - --func Test_options() -+func Test_options_command() - let caught = 'ok' - try - options -@@ -383,6 +383,13 @@ func Test_set_all() - set tw& iskeyword& splitbelow& - endfunc - -+func Test_set_one_column() -+ let out_mult = execute('set all')->split("\n") -+ let out_one = execute('set! all')->split("\n") -+ " one column should be two to four times as many lines -+ call assert_inrange(len(out_mult) * 2, len(out_mult) * 4, len(out_one)) -+endfunc -+ - func Test_set_values() - if filereadable('opt_test.vim') - source opt_test.vim -diff --git a/src/vim.h b/src/vim.h -index cd917a3..171b5dc 100644 ---- a/src/vim.h -+++ b/src/vim.h -@@ -1227,12 +1227,13 @@ typedef struct { - * When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global - * values, get local value. - */ --#define OPT_FREE 1 // free old value if it was allocated --#define OPT_GLOBAL 2 // use global value --#define OPT_LOCAL 4 // use local value --#define OPT_MODELINE 8 // option in modeline --#define OPT_WINONLY 16 // only set window-local options --#define OPT_NOWIN 32 // don't set window-local options -+#define OPT_FREE 0x01 // free old value if it was allocated -+#define OPT_GLOBAL 0x02 // use global value -+#define OPT_LOCAL 0x04 // use local value -+#define OPT_MODELINE 0x08 // option in modeline -+#define OPT_WINONLY 0x10 // only set window-local options -+#define OPT_NOWIN 0x20 // don't set window-local options -+#define OPT_ONECOLUMN 0x40 // list options one per line - - // Magic chars used in confirm dialog strings - #define DLG_BUTTON_SEP '\n' --- -2.33.0 - diff --git a/backport-cannot-use-z-when-spell-is-off.patch b/backport-cannot-use-z-when-spell-is-off.patch deleted file mode 100644 index 87af95c4f58700fabe1374197df174f6a5035426..0000000000000000000000000000000000000000 --- a/backport-cannot-use-z-when-spell-is-off.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 152e79e94bb935e75b866bd55479648cde11066a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 10 Jun 2020 15:32:08 +0200 -Subject: [PATCH] patch 8.2.0945: cannot use "z=" when 'spell' is off - -Reference:https://github.com/vim/vim/commit/152e79e94bb935e75b866bd55479648cde11066a -Conflict:The software package does not contain the Test_spellsuggest function. - -Problem: Cannot use "z=" when 'spell' is off. -Solution: Make "z=" work even when 'spell' is off. (Christian Brabandt, - Gary Johnson, closes #6227) ---- - runtime/doc/eval.txt | 8 +++---- - src/evalfunc.c | 46 ++++++++++++++++++++++++++++++++++++-- - src/globals.h | 3 +++ - src/spell.c | 2 +- - src/spellsuggest.c | 13 ++++++++++- - src/testdir/test_spell.vim | 37 +++++++++++++++++++++++++++--- - 6 files changed, 97 insertions(+), 12 deletions(-) - -diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt -index b28fac9..1aeb193 100644 ---- a/runtime/doc/eval.txt -+++ b/runtime/doc/eval.txt -@@ -9071,9 +9071,8 @@ spellbadword([{sentence}]) - echo spellbadword("the quik brown fox") - < ['quik', 'bad'] ~ - -- The spelling information for the current window is used. The -- 'spell' option must be set and the value of 'spelllang' is -- used. -+ The spelling information for the current window and the value -+ of 'spelllang' are used. - - Can also be used as a |method|: > - GetText()->spellbadword() -@@ -9098,8 +9097,7 @@ spellsuggest({word} [, {max} [, {capital}]]) - although it may appear capitalized. - - The spelling information for the current window is used. The -- 'spell' option must be set and the values of 'spelllang' and -- 'spellsuggest' are used. -+ values of 'spelllang' and 'spellsuggest' are used. - - Can also be used as a |method|: > - GetWord()->spellsuggest() -diff --git a/src/evalfunc.c b/src/evalfunc.c -index 892a753..24bd7b1 100644 ---- a/src/evalfunc.c -+++ b/src/evalfunc.c -@@ -6903,9 +6903,30 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) - char_u *word = (char_u *)""; - hlf_T attr = HLF_COUNT; - int len = 0; -+#ifdef FEAT_SPELL -+ int wo_spell_save = curwin->w_p_spell; -+ -+ if (!curwin->w_p_spell) -+ { -+ did_set_spelllang(curwin); -+ curwin->w_p_spell = TRUE; -+ } -+ -+ if (*curwin->w_s->b_p_spl == NUL) -+ { -+ emsg(_(e_no_spell)); -+ curwin->w_p_spell = wo_spell_save; -+ return; -+ } -+#endif - - if (rettv_list_alloc(rettv) == FAIL) -+ { -+#ifdef FEAT_SPELL -+ curwin->w_p_spell = wo_spell_save; -+#endif - return; -+ } - - #ifdef FEAT_SPELL - if (argvars[0].v_type == VAR_UNKNOWN) -@@ -6918,7 +6939,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) - curwin->w_set_curswant = TRUE; - } - } -- else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL) -+ else if (*curbuf->b_s.b_p_spl != NUL) - { - char_u *str = tv_get_string_chk(&argvars[0]); - int capcol = -1; -@@ -6940,6 +6961,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) - } - } - } -+ curwin->w_p_spell = wo_spell_save; - #endif - - list_append_string(rettv->vval.v_list, word, len); -@@ -6965,13 +6987,32 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv) - int i; - listitem_T *li; - int need_capital = FALSE; -+ int wo_spell_save = curwin->w_p_spell; -+ -+ if (!curwin->w_p_spell) -+ { -+ did_set_spelllang(curwin); -+ curwin->w_p_spell = TRUE; -+ } -+ -+ if (*curwin->w_s->b_p_spl == NUL) -+ { -+ emsg(_(e_no_spell)); -+ curwin->w_p_spell = wo_spell_save; -+ return; -+ } - #endif - - if (rettv_list_alloc(rettv) == FAIL) -+ { -+#ifdef FEAT_SPELL -+ curwin->w_p_spell = wo_spell_save; -+#endif - return; -+ } - - #ifdef FEAT_SPELL -- if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) -+ if (*curwin->w_s->b_p_spl != NUL) - { - str = tv_get_string(&argvars[0]); - if (argvars[1].v_type != VAR_UNKNOWN) -@@ -7008,6 +7049,7 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv) - } - ga_clear(&ga); - } -+ curwin->w_p_spell = wo_spell_save; - #endif - } - -diff --git a/src/globals.h b/src/globals.h -index 77a42d8..bdda224 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1492,6 +1492,9 @@ EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command")); - #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL) - EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory")); - #endif -+#ifdef FEAT_SPELL -+EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible")); -+#endif - #ifdef FEAT_LIBCALL - EXTERN char e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\"")); - #endif -diff --git a/src/spell.c b/src/spell.c -index 572f7fb..d8310fa 100644 ---- a/src/spell.c -+++ b/src/spell.c -@@ -1225,7 +1225,7 @@ no_spell_checking(win_T *wp) - if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL - || wp->w_s->b_langp.ga_len == 0) - { -- emsg(_("E756: Spell checking is not enabled")); -+ emsg(_(e_no_spell)); - return TRUE; - } - return FALSE; -diff --git a/src/spellsuggest.c b/src/spellsuggest.c -index 9d6df79..06e0ad1 100644 ---- a/src/spellsuggest.c -+++ b/src/spellsuggest.c -@@ -471,9 +471,19 @@ spell_suggest(int count) - int selected = count; - int badlen = 0; - int msg_scroll_save = msg_scroll; -+ int wo_spell_save = curwin->w_p_spell; - -- if (no_spell_checking(curwin)) -+ if (!curwin->w_p_spell) -+ { -+ did_set_spelllang(curwin); -+ curwin->w_p_spell = TRUE; -+ } -+ -+ if (*curwin->w_s->b_p_spl == NUL) -+ { -+ emsg(_(e_no_spell)); - return; -+ } - - if (VIsual_active) - { -@@ -687,6 +697,7 @@ spell_suggest(int count) - spell_find_cleanup(&sug); - skip: - vim_free(line); -+ curwin->w_p_spell = wo_spell_save; - } - - /* -diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index 79fb892..f10ec61 100644 ---- a/src/testdir/test_spell.vim -+++ b/src/testdir/test_spell.vim -@@ -99,11 +99,14 @@ foobar/? - set spelllang=Xwords.spl - call assert_equal(['foobar', 'rare'], spellbadword('foo foobar')) - -- " Typo should not be detected without the 'spell' option. -+ " Typo should be detected even without the 'spell' option. - set spelllang=en_gb nospell - call assert_equal(['', ''], spellbadword('centre')) -- call assert_equal(['', ''], spellbadword('My bycycle.')) -- call assert_equal(['', ''], spellbadword('A sentence. another sentence')) -+ call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) -+ call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) -+ -+ set spelllang= -+ call assert_fails("call spellbadword('maxch')", 'E756:') - - call delete('Xwords.spl') - call delete('Xwords') -@@ -415,6 +418,34 @@ func Test_zeq_crash() - bwipe! - endfunc - -+" Check that z= works even when 'nospell' is set. This test uses one of the -+" tests in Test_spellsuggest_option_number() just to verify that z= basically -+" works and that "E756: Spell checking is not enabled" is not generated. -+func Test_zeq_nospell() -+ new -+ set nospell spellsuggest=1,best -+ call setline(1, 'A baord') -+ try -+ norm $1z= -+ call assert_equal('A board', getline(1)) -+ catch -+ call assert_report("Caught exception: " . v:exception) -+ endtry -+ set spell& spellsuggest& -+ bwipe! -+endfunc -+ -+" Check that "E756: Spell checking is not possible" is reported when z= is -+" executed and 'spelllang' is empty. -+func Test_zeq_no_spelllang() -+ new -+ set spelllang= spellsuggest=1,best -+ call setline(1, 'A baord') -+ call assert_fails('normal $1z=', 'E756:') -+ set spelllang& spellsuggest& -+ bwipe! -+endfunc -+ - " Check handling a word longer than MAXWLEN. - func Test_spell_long_word() - set enc=utf-8 --- -2.27.0 - diff --git a/backport-command-line-editing-not-sufficiently-tested.patch b/backport-command-line-editing-not-sufficiently-tested.patch deleted file mode 100644 index 978d6aaf899b0e39b38c070a253759b801a8917f..0000000000000000000000000000000000000000 --- a/backport-command-line-editing-not-sufficiently-tested.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 59cb041d0a56d8555857da7e063ec61504ee1fa7 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 18 Dec 2019 22:26:31 +0100 -Subject: [PATCH] patch 8.2.0023: command line editing not sufficiently tested -Problem: Command line editing not sufficiently tested. -Solution: Add more tests. (Dominique Pelle, closes #5374) - -Reference:https://github.com/vim/vim/commit/59cb041d0a56d8555857da7e063ec61504ee1fa7 ---- - src/testdir/Make_all.mak | 1 + - src/testdir/test_alot.vim | 1 + - src/testdir/test_cmdline.vim | 56 +++++++++++++++++++++++++++++++++----------- - src/testdir/test_ex_mode.vim | 54 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 98 insertions(+), 14 deletions(-) - create mode 100644 src/testdir/test_ex_mode.vim - -diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak -index 665bcc7..05e7a2c 100644 ---- a/src/testdir/Make_all.mak -+++ b/src/testdir/Make_all.mak -@@ -102,6 +102,7 @@ NEW_TESTS = \ - test_ex_equal \ - test_ex_undo \ - test_ex_z \ -+ test_ex_mode \ - test_excmd \ - test_exec_while_if \ - test_execute_func \ -diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim -index 894ec58..25241b2 100644 ---- a/src/testdir/test_alot.vim -+++ b/src/testdir/test_alot.vim -@@ -13,6 +13,7 @@ source test_delete.vim - source test_ex_equal.vim - source test_ex_undo.vim - source test_ex_z.vim -+source test_ex_mode.vim - source test_execute_func.vim - source test_expand.vim - source test_expand_dllpath.vim -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 5297951..837ef63 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -419,7 +419,7 @@ func Test_expand_star_star() - call delete('a', 'rf') - endfunc - --func Test_paste_in_cmdline() -+func Test_cmdline_paste() - let @a = "def" - call feedkeys(":abc \a ghi\\"\", 'tx') - call assert_equal('"abc def ghi', @:) -@@ -459,18 +459,37 @@ func Test_paste_in_cmdline() - bwipe! - endfunc - --func Test_remove_char_in_cmdline() -- call feedkeys(":abc def\\\\"\", 'tx') -- call assert_equal('"abc ef', @:) -+func Test_cmdline_remove_char() -+ let encoding_save = &encoding -+ -+ for e in ['utf8', 'latin1'] -+ exe 'set encoding=' . e -+ -+ call feedkeys(":abc def\\\\"\", 'tx') -+ call assert_equal('"abc ef', @:, e) -+ -+ call feedkeys(":abc def\\\\"\", 'tx') -+ call assert_equal('"abcdef', @:) -+ -+ call feedkeys(":abc def ghi\\\\"\", 'tx') -+ call assert_equal('"abc ghi', @:, e) - -- call feedkeys(":abc def\\\\"\", 'tx') -- call assert_equal('"abcdef', @:) -+ call feedkeys(":abc def\\\\"\", 'tx') -+ call assert_equal('"def', @:, e) -+ endfor -+ -+ let &encoding = encoding_save -+endfunc - -- call feedkeys(":abc def ghi\\\\"\", 'tx') -- call assert_equal('"abc ghi', @:) -+func Test_cmdline_keymap_ctrl_hat() -+ if !has('keymap') -+ return -+ endif - -- call feedkeys(":abc def\\\\"\", 'tx') -- call assert_equal('"def', @:) -+ set keymap=esperanto -+ call feedkeys(":\"Jxauxdo \Jxauxdo \Jxauxdo\", 'tx') -+ call assert_equal('"Jxauxdo Ä´aÅ­do Jxauxdo', @:) -+ set keymap= - endfunc - - func Test_illegal_address1() -@@ -741,20 +760,20 @@ func Test_cmdline_overstrike() - - " Test overstrike in the middle of the command line. - call feedkeys(":\"01234\\\ab\\cd\", 'xt') -- call assert_equal('"0ab1cd4', @:) -+ call assert_equal('"0ab1cd4', @:, e) - - " Test overstrike going beyond end of command line. - call feedkeys(":\"01234\\\ab\\cdefgh\", 'xt') -- call assert_equal('"0ab1cdefgh', @:) -+ call assert_equal('"0ab1cdefgh', @:, e) - - " Test toggling insert/overstrike a few times. - call feedkeys(":\"01234\\ab\\cd\\ef\", 'xt') -- call assert_equal('"ab0cd3ef4', @:) -+ call assert_equal('"ab0cd3ef4', @:, e) - endfor - - " Test overstrike with multi-byte characters. - call feedkeys(":\"テキストエディタ\\\ab\\cd\", 'xt') -- call assert_equal('"テabã‚­cdエディタ', @:) -+ call assert_equal('"テabã‚­cdエディタ', @:, e) - - let &encoding = encoding_save - endfunc -diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim -new file mode 100644 -index 0000000..00a35a3 ---- /dev/null -+++ b/src/testdir/test_ex_mode.vim -@@ -0,0 +1,54 @@ -+" Test editing line in Ex mode (see :help Q and :help gQ). -+ -+" Helper function to test editing line in Q Ex mode -+func Ex_Q(cmd) -+ " Is there a simpler way to test editing Ex line? -+ call feedkeys("Q" -+ \ .. "let s:test_ex =<< END\" -+ \ .. a:cmd .. "\" -+ \ .. "END\" -+ \ .. "visual\", 'tx') -+ return s:test_ex[0] -+endfunc -+ -+" Helper function to test editing line in gQ Ex mode -+func Ex_gQ(cmd) -+ call feedkeys("gQ" .. a:cmd .. "\\"\", 'tx') -+ let ret = @:[1:] " Remove leading quote. -+ call feedkeys("visual\", 'tx') -+ return ret -+endfunc -+ -+" Helper function to test editing line with both Q and gQ Ex mode. -+func Ex(cmd) -+ return [Ex_Q(a:cmd), Ex_gQ(a:cmd)] -+endfunc -+ -+" Test editing line in Ex mode (both Q and gQ) -+func Test_ex_mode() -+ let encoding_save = &encoding -+ set sw=2 -+ -+ for e in ['utf8', 'latin1'] -+ exe 'set encoding=' . e -+ -+ call assert_equal(['bar', 'bar'], Ex("foo bar\bar"), e) -+ call assert_equal(["1\2", "1\2"], Ex("1\\2"), e) -+ call assert_equal(["1\2\3", '213'], Ex("1\2\3"), e) -+ call assert_equal(['0123', '2013'], Ex("01\2\3"), e) -+ call assert_equal(['0123', '0213'], Ex("01\2\3"), e) -+ call assert_equal(['01234', '0342'], Ex("012\\\3\4"), e) -+ call assert_equal(["foo bar\", 'foo '], Ex("foo bar\"), e) -+ call assert_equal(['foo', 'foo'], Ex("fooba\\"), e) -+ call assert_equal(["foo\tbar", 'foobar'], Ex("foo\bar"), e) -+ call assert_equal(["abbrev\t", 'abbreviate'], Ex("abbrev\"), e) -+ call assert_equal([' 1', "1\\"], Ex("1\\"), e) -+ call assert_equal([' 1', "1\\"], Ex("1\\\"), e) -+ call assert_equal([' foo', ' foo'], Ex(" foo\"), e) -+ call assert_equal(['foo', ' foo0'], Ex(" foo0\"), e) -+ call assert_equal(['foo', ' foo^'], Ex(" foo^\"), e) -+ endfor -+ -+ set sw& -+ let &encoding = encoding_save -+endfunc --- -2.27.0 diff --git a/backport-crash-when-pasting-too-many-times.patch b/backport-crash-when-pasting-too-many-times.patch deleted file mode 100644 index ffc2f8bb4f27edd42e1744a21dc509e4ac2862be..0000000000000000000000000000000000000000 --- a/backport-crash-when-pasting-too-many-times.patch +++ /dev/null @@ -1,67 +0,0 @@ -From eeed1c7ae090c17f4df51cf97b2a9e4d8b4f4dc7 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 10 Oct 2021 12:35:17 +0100 -Subject: [PATCH] patch 8.2.3492: crash when pasting too many times - -Problem: Crash when pasting too many times. -Solution: Limit the size to what fits in an int. (closes #8962) - ---- - src/globals.h | 1 + - src/register.c | 11 +++++++++-- - src/testdir/test_put.vim | 8 ++++++++ - 3 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/src/globals.h b/src/globals.h -index fee8c7f..7be3bfd 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1659,6 +1659,7 @@ EXTERN char e_menuothermode[] INIT(= N_("E328: Menu only exists in another mode" - #endif - EXTERN char e_invalwindow[] INIT(= N_("E957: Invalid window number")); - EXTERN char e_listarg[] INIT(= N_("E686: Argument of %s must be a List")); -+EXTERN char e_resulting_text_too_long[] INIT(= N_("E1240: Resulting text too long")); - - #ifdef FEAT_GUI_MAC - EXTERN short disallow_gui INIT(= FALSE); -diff --git a/src/register.c b/src/register.c -index 24e4b99..bab27fe 100644 ---- a/src/register.c -+++ b/src/register.c -@@ -1908,8 +1908,15 @@ do_put( - } - - do { -- totlen = count * yanklen; -- if (totlen > 0) -+ long multlen = count * yanklen; -+ -+ totlen = multlen; -+ if (totlen != multlen) -+ { -+ emsg(_(e_resulting_text_too_long)); -+ break; -+ } -+ else if (totlen > 0) - { - oldp = ml_get(lnum); - if (VIsual_active && col > (int)STRLEN(oldp)) -diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim -index f5037dc..42bb7e6 100644 ---- a/src/testdir/test_put.vim -+++ b/src/testdir/test_put.vim -@@ -122,3 +122,11 @@ func Test_put_above_first_line() - call assert_equal('text', getline(1)) - bwipe! - endfunc -+ -+func Test_very_larg_count() -+ new -+ let @" = 'x' -+ call assert_fails('norm 44444444444444p', 'E1240:') -+ bwipe! -+endfunc -+ --- -2.27.0 - diff --git a/backport-find-test-fails.patch b/backport-find-test-fails.patch deleted file mode 100644 index ec8314f0795c82ba8ddf959b41024930f189d5a0..0000000000000000000000000000000000000000 --- a/backport-find-test-fails.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e015d99abb4276f47ce97bad1ad5ff0c658b1c8a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 17 Nov 2021 19:01:53 +0000 -Subject: [PATCH] patch 8.2.3613: :find test fails - -Problem: :find test fails. -Solution: Put length check inside if block. - -Reference:https://github.com/vim/vim/commit/e015d99abb4276f47ce97bad1ad5ff0c658b1c8a ---- - src/findfile.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/findfile.c b/src/findfile.c -index 7a4dfe5..b9a0e47 100644 ---- a/src/findfile.c -+++ b/src/findfile.c -@@ -1727,11 +1727,11 @@ find_file_in_path_option( - proc->pr_WindowPtr = (APTR)-1L; - # endif - -- if (len == 0) -- return NULL; -- - if (first == TRUE) - { -+ if (len == 0) -+ return NULL; -+ - // copy file name into NameBuff, expanding environment variables - save_char = ptr[len]; - ptr[len] = NUL; --- -2.23.0 \ No newline at end of file diff --git a/backport-fix-arglist-test-fails.patch b/backport-fix-arglist-test-fails.patch deleted file mode 100644 index f14e49b7d9fd707dcd0e3b25891f0a6729085ad2..0000000000000000000000000000000000000000 --- a/backport-fix-arglist-test-fails.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 679140c56bbabf12a199d94f584b1b9dfc9809fd Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 24 Dec 2021 18:58:46 +0000 -Subject: [PATCH] patch 8.2.3885: arglist test fails -Conflict:Abridged some of the notes -Reference:https://github.com/vim/vim/commit/679140c56bbabf12a199d94f584b1b9dfc9809fd - -Problem: Arglist test fails. -Solution: Adjust for locking the arglist for ":all". - ---- - src/testdir/test_arglist.vim | 13 ++++++------- - 1 file changed, 6 insertions(+), 7 deletions(-) - -diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim -index 7ebe8a2..e5a5e89 100644 ---- a/src/testdir/test_arglist.vim -+++ b/src/testdir/test_arglist.vim -@@ -470,15 +470,14 @@ func Test_arglist_autocmd() - new - " redefine arglist; go to Xxx1 - next! Xxx1 Xxx2 Xxx3 -- " open window for all args -- all -+ " open window for all args; Reading Xxx2 will try to change the arglist and -+ " that will fail -+ call assert_fails("all", "E1156:") - call assert_equal('test file Xxx1', getline(1)) - wincmd w -- wincmd w -- call assert_equal('test file Xxx1', getline(1)) -- " should now be in Xxx2 -- rewind - call assert_equal('test file Xxx2', getline(1)) -+ wincmd w -+ call assert_equal('test file Xxx3', getline(1)) - - autocmd! BufReadPost Xxx2 - enew! | only -@@ -515,6 +514,6 @@ endfunc - func Test_clear_arglist_in_all() - n 0 00 000 0000 00000 000000 - au! * 0 n 0 -- all -+ call assert_fails("all", "E1156") - au! * - endfunc --- -2.27.0 - diff --git a/backport-fix-giving-the-error-0-more-files-to-edit.patch b/backport-fix-giving-the-error-0-more-files-to-edit.patch deleted file mode 100644 index a98fc9eb8dc1fbf625cb55b97f249247e475149b..0000000000000000000000000000000000000000 --- a/backport-fix-giving-the-error-0-more-files-to-edit.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 7b22117c4ecf383b6f35acef041773a83ec28220 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 17 Aug 2020 19:34:10 +0200 -Subject: [PATCH] patch 8.2.1472: ":argdel" does not work like ":.argdel" as - documented -Conflict:NA -Reference:https://github.com/vim/vim/commit/7b22117c4ecf383b6f35acef041773a83ec28220 - -Problem: ":argdel" does not work like ":.argdel" as documented. (Alexey - Demin) -Solution: Make ":argdel" work like ":.argdel". (closes #6727) - Also fix giving the error "0 more files to edit". - ---- - src/arglist.c | 18 +++++++++++++----- - src/ex_docmd.c | 2 +- - src/testdir/test_arglist.vim | 10 ++++++++-- - 3 files changed, 22 insertions(+), 8 deletions(-) - -diff --git a/src/arglist.c b/src/arglist.c -index b1a6a0b..cab74f8 100644 ---- a/src/arglist.c -+++ b/src/arglist.c -@@ -776,10 +776,20 @@ ex_argdelete(exarg_T *eap) - int i; - int n; - -- if (eap->addr_count > 0) -+ if (eap->addr_count > 0 || *eap->arg == NUL) - { -- // ":1,4argdel": Delete all arguments in the range. -- if (eap->line2 > ARGCOUNT) -+ // ":argdel" works like ":argdel" -+ if (eap->addr_count == 0) -+ { -+ if (curwin->w_arg_idx >= ARGCOUNT) -+ { -+ emsg(_("E610: No argument to delete")); -+ return; -+ } -+ eap->line1 = eap->line2 = curwin->w_arg_idx + 1; -+ } -+ else if (eap->line2 > ARGCOUNT) -+ // ":1,4argdel": Delete all arguments in the range. - eap->line2 = ARGCOUNT; - n = eap->line2 - eap->line1 + 1; - if (*eap->arg != NUL) -@@ -808,8 +818,6 @@ ex_argdelete(exarg_T *eap) - curwin->w_arg_idx = ARGCOUNT - 1; - } - } -- else if (*eap->arg == NUL) -- emsg(_(e_argreq)); - else - do_arglist(eap->arg, AL_DEL, 0, FALSE); - #ifdef FEAT_TITLE -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index cb6b64a..dfcbf37 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -4719,7 +4719,7 @@ check_more( - int n = ARGCOUNT - curwin->w_arg_idx - 1; - - if (!forceit && only_one_window() -- && ARGCOUNT > 1 && !arg_had_last && n >= 0 && quitmore == 0) -+ && ARGCOUNT > 1 && !arg_had_last && n > 0 && quitmore == 0) - { - if (message) - { -diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim -index c486b18..3e1e175 100644 ---- a/src/testdir/test_arglist.vim -+++ b/src/testdir/test_arglist.vim -@@ -416,9 +416,15 @@ func Test_argdelete() - last - argdelete % - call assert_equal(['b'], argv()) -- call assert_fails('argdelete', 'E471:') -+ call assert_fails('argdelete', 'E610:') - call assert_fails('1,100argdelete', 'E16:') -- %argd -+ -+ call Reset_arglist() -+ args a b c d -+ next -+ argdel -+ call Assert_argc(['a', 'c', 'd']) -+ %argdel - endfunc - - func Test_argdelete_completion() --- -2.27.0 - diff --git a/backport-fix-test-failed.patch b/backport-fix-test-failed.patch deleted file mode 100644 index 349d64ede1f876821a9d08f506997543b76c0897..0000000000000000000000000000000000000000 --- a/backport-fix-test-failed.patch +++ /dev/null @@ -1,58 +0,0 @@ -From be99042b03edf7b8156c9adbc23516bfcf2cec0f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 30 May 2022 16:01:42 +0100 -Subject: [PATCH] patch 8.2.5044: command line test fails - -Problem: Command line test fails. -Solution: Also beep when cmdline win can't be opened because of locks. - Make the test not beep. Make the test pass on MS-Windows. - ---- - src/ex_getln.c | 6 ++---- - src/testdir/test_substitute.vim | 5 +++-- - 2 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index d5fc38d..7571ae2 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -4186,11 +4186,9 @@ open_cmdwin(void) - #endif - - // Can't do this when text or buffer is locked. -- if (text_or_buf_locked()) -- return K_IGNORE; -- - // Can't do this recursively. Can't do it when typing a password. -- if (cmdwin_type != 0 -+ if (text_or_buf_locked() -+ || cmdwin_type != 0 - # if defined(FEAT_CRYPT) || defined(FEAT_EVAL) - || cmdline_star > 0 - # endif -diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim -index 367f472..3450c4f 100644 ---- a/src/testdir/test_substitute.vim -+++ b/src/testdir/test_substitute.vim -@@ -781,6 +781,7 @@ func Test_sub_open_cmdline_win() - " the error only happens in a very specific setup, run a new Vim instance to - " get a clean starting point. - let lines =<< trim [SCRIPT] -+ set vb t_vb= - norm o0000000000000000000000000000000000000000000000000000 - func Replace() - norm q/ -@@ -793,8 +794,8 @@ func Test_sub_open_cmdline_win() - [SCRIPT] - call writefile(lines, 'Xscript') - if RunVim([], [], '-u NONE -S Xscript') -- let messages = readfile('Xresult') -- call assert_match('E565: Not allowed to change text or change window', messages[3]) -+ call assert_match('E565: Not allowed to change text or change window', -+ \ readfile('Xresult')->join('XX')) - endif - - call delete('Xscript') --- -2.27.0 - diff --git a/backport-html-text-objects-are-not-fully-tested.patch b/backport-html-text-objects-are-not-fully-tested.patch deleted file mode 100644 index a35afdcd73fade9f95f5033532899475bb8ca9c6..0000000000000000000000000000000000000000 --- a/backport-html-text-objects-are-not-fully-tested.patch +++ /dev/null @@ -1,164 +0,0 @@ -From af631f61bc42d0dddafe1bc0c06872cf3aaeb239 Mon Sep 17 00:00:00 2001 -From: Dominique Pelle -Date: Fri, 3 Sep 2021 16:50:16 +0200 -Subject: [PATCH] patch 8.2.3398: html text objects are not fully tested -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Problem: Html text objects are not fully tested. -Solution: Add tests for dbcs encoding and different number of backslashes. -(Dominique Pellé, closes #8831) ---- - src/testdir/test_textobjects.vim | 135 ++++++++++++++++++++------------------- - 1 file changed, 70 insertions(+), 65 deletions(-) - -diff --git a/src/testdir/test_textobjects.vim b/src/testdir/test_textobjects.vim -index 042c534..49fc9c8 100644 ---- a/src/testdir/test_textobjects.vim -+++ b/src/testdir/test_textobjects.vim -@@ -88,71 +88,76 @@ endfunc - - " Tests for string and html text objects - func Test_string_html_objects() -- enew! -- -- let t = '"wo\"rd\\" foo' -- put =t -- normal! da" -- call assert_equal('foo', getline('.')) -- -- let t = "'foo' 'bar' 'piep'" -- put =t -- normal! 0va'a'rx -- call assert_equal("xxxxxxxxxxxx'piep'", getline('.')) -- -- let t = "bla bla `quote` blah" -- put =t -- normal! 02f`da` -- call assert_equal("bla bla blah", getline('.')) -- -- let t = 'out " in "noXno"' -- put =t -- normal! 0fXdi" -- call assert_equal('out " in ""', getline('.')) -- -- let t = "\"'\" 'blah' rep 'buh'" -- put =t -- normal! 03f'vi'ry -- call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.')) -- -- set quoteescape=+*- -- let t = "bla `s*`d-`+++`l**` b`la" -- put =t -- normal! di` -- call assert_equal("bla `` b`la", getline('.')) -- -- let t = 'voo "nah" sdf " asdf" sdf " sdf" sd' -- put =t -- normal! $F"va"oha"i"rz -- call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.')) -- -- let t = "-asdfXasdfasdf-" -- put =t -- normal! fXdit -- call assert_equal('-asdfasdf-', getline('.')) -- -- let t = "-asdXasdfasdf-" -- put =t -- normal! 0fXdit -- call assert_equal('--', getline('.')) -- -- let t = "-asdfXasdfasdf-" -- put =t -- normal! fXdat -- call assert_equal('-asdfasdf-', getline('.')) -- -- let t = "-asdXasdfasdf-" -- put =t -- normal! 0fXdat -- call assert_equal('--', getline('.')) -- -- let t = "-\ninnertext object\n" -- put =t -- normal! dit -- call assert_equal('-', getline('.')) -- -- set quoteescape& -- enew! -+ for e in ['utf-8', 'latin1', 'cp932'] -+ enew! -+ exe 'set enc=' .. e -+ -+ let t = '"wo\"rd\\" foo' -+ put =t -+ normal! da" -+ call assert_equal('foo', getline('.'), e) -+ -+ let t = "'foo' 'bar' 'piep'" -+ put =t -+ normal! 0va'a'rx -+ call assert_equal("xxxxxxxxxxxx'piep'", getline('.'), e) -+ -+ let t = "bla bla `quote` blah" -+ put =t -+ normal! 02f`da` -+ call assert_equal("bla bla blah", getline('.'), e) -+ -+ let t = 'out " in "noXno"' -+ put =t -+ normal! 0fXdi" -+ call assert_equal('out " in ""', getline('.'), e) -+ -+ let t = "\"'\" 'blah' rep 'buh'" -+ put =t -+ normal! 03f'vi'ry -+ call assert_equal("\"'\" 'blah'yyyyy'buh'", getline('.'), e) -+ -+ set quoteescape=+*- -+ let t = "bla `s*`d-`+++`l**` b`la" -+ put =t -+ normal! di` -+ call assert_equal("bla `` b`la", getline('.'), e) -+ -+ let t = 'voo "nah" sdf " asdf" sdf " sdf" sd' -+ put =t -+ normal! $F"va"oha"i"rz -+ call assert_equal('voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd', getline('.'), e) -+ -+ let t = "-asdfXasdfasdf-" -+ put =t -+ normal! fXdit -+ call assert_equal('-asdfasdf-', getline('.'), e) -+ -+ let t = "-asdXasdfasdf-" -+ put =t -+ normal! 0fXdit -+ call assert_equal('--', getline('.'), e) -+ -+ let t = "-asdfXasdfasdf-" -+ put =t -+ normal! fXdat -+ call assert_equal('-asdfasdf-', getline('.'), e) -+ -+ let t = "-asdXasdfasdf-" -+ put =t -+ normal! 0fXdat -+ call assert_equal('--', getline('.'), e) -+ -+ let t = "-\ninnertext object\n" -+ put =t -+ normal! dit -+ call assert_equal('-', getline('.'), e) -+ -+ set quoteescape& -+ endfor -+ -+ set enc=utf-8 -+ bwipe! - endfunc - - func Test_empty_html_tag() --- -1.8.3.1 - diff --git a/backport-illegal-memory-access.patch b/backport-illegal-memory-access.patch deleted file mode 100644 index cf1d01e179d22a834b2e9d2075476162b1ff08f3..0000000000000000000000000000000000000000 --- a/backport-illegal-memory-access.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 85be8563fe5aff686e9e30d6afff401ccd976f2a Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 25 Nov 2021 20:40:11 +0000 -Subject: [PATCH] patch 8.2.3678: illegal memory access - -Problem: Illegal memory access. -Solution: Ignore changed indent when computing byte offset. ---- - src/register.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/register.c b/src/register.c -index 49f4079..7f77ada 100644 ---- a/src/register.c -+++ b/src/register.c -@@ -1969,6 +1969,7 @@ do_put( - } - else - { -+ size_t len; - // Insert at least one line. When y_type is MCHAR, break the first - // line in two. - for (cnt = 1; cnt <= count; ++cnt) -@@ -2074,11 +2075,12 @@ error: - // Put the '] mark on the first byte of the last inserted character. - // Correct the length for change in indent. - curbuf->b_op_end.lnum = lnum; -- col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff; -+ len = STRLEN(y_array[y_size - 1]); -+ col = (colnr_T)len - lendiff; - if (col > 1) - curbuf->b_op_end.col = col - 1 - - mb_head_off(y_array[y_size - 1], -- y_array[y_size - 1] + col - 1); -+ y_array[y_size - 1] + len - 1); - else - curbuf->b_op_end.col = 0; - --- -1.8.3.1 - diff --git a/backport-insufficient-code-coverage-for-ex_docmd.c_functions.patch b/backport-insufficient-code-coverage-for-ex_docmd.c_functions.patch deleted file mode 100644 index ef2b711fc7cabc3e1038f14ddea4bb5b3371d43e..0000000000000000000000000000000000000000 --- a/backport-insufficient-code-coverage-for-ex_docmd.c_functions.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 9f6277bdde97b7767ded43a0b5a2023eb601b3b7 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 11 Feb 2020 22:04:02 +0100 -Subject: [PATCH] patch 8.2.0243: insufficient code coverage for ex_docmd.c - functions - -Problem: Insufficient code coverage for ex_docmd.c functions. -Solution: Add more tests. (Yegappan Lakshmanan, closes #5618) ---- - src/testdir/Make_all.mak | 2 ++ - src/testdir/test_buffer.vim | 66 +++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 68 insertions(+) - create mode 100644 src/testdir/test_buffer.vim - -diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak -index 05e7a2c..e608b92 100644 ---- a/src/testdir/Make_all.mak -+++ b/src/testdir/Make_all.mak -@@ -65,6 +65,7 @@ NEW_TESTS = \ - test_blob \ - test_blockedit \ - test_breakindent \ -+ test_buffer \ - test_bufline \ - test_bufwintabinfo \ - test_cd \ -@@ -307,6 +308,7 @@ NEW_TESTS_RES = \ - test_blob.res \ - test_blockedit.res \ - test_breakindent.res \ -+ test_buffer.res \ - test_bufwintabinfo.res \ - test_cdo.res \ - test_changelist.res \ -diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim -new file mode 100644 -index 0000000..dc35bb4 ---- /dev/null -+++ b/src/testdir/test_buffer.vim -@@ -0,0 +1,66 @@ -+" Tests for Vim buffer -+ -+" Test for the :bunload command with an offset -+func Test_bunload_with_offset() -+ %bwipe! -+ call writefile(['B1'], 'b1') -+ call writefile(['B2'], 'b2') -+ call writefile(['B3'], 'b3') -+ call writefile(['B4'], 'b4') -+ -+ " Load four buffers. Unload the second and third buffers and then -+ " execute .+3bunload to unload the last buffer. -+ edit b1 -+ new b2 -+ new b3 -+ new b4 -+ -+ bunload b2 -+ bunload b3 -+ exe bufwinnr('b1') . 'wincmd w' -+ .+3bunload -+ call assert_equal(0, getbufinfo('b4')[0].loaded) -+ call assert_equal('b1', -+ \ fnamemodify(getbufinfo({'bufloaded' : 1})[0].name, ':t')) -+ -+ " Load four buffers. Unload the third and fourth buffers. Execute .+3bunload -+ " and check whether the second buffer is unloaded. -+ ball -+ bunload b3 -+ bunload b4 -+ exe bufwinnr('b1') . 'wincmd w' -+ .+3bunload -+ call assert_equal(0, getbufinfo('b2')[0].loaded) -+ call assert_equal('b1', -+ \ fnamemodify(getbufinfo({'bufloaded' : 1})[0].name, ':t')) -+ -+ " Load four buffers. Unload the second and third buffers and from the last -+ " buffer execute .-3bunload to unload the first buffer. -+ ball -+ bunload b2 -+ bunload b3 -+ exe bufwinnr('b4') . 'wincmd w' -+ .-3bunload -+ call assert_equal(0, getbufinfo('b1')[0].loaded) -+ call assert_equal('b4', -+ \ fnamemodify(getbufinfo({'bufloaded' : 1})[0].name, ':t')) -+ -+ " Load four buffers. Unload the first and second buffers. Execute .-3bunload -+ " from the last buffer and check whether the third buffer is unloaded. -+ ball -+ bunload b1 -+ bunload b2 -+ exe bufwinnr('b4') . 'wincmd w' -+ .-3bunload -+ call assert_equal(0, getbufinfo('b3')[0].loaded) -+ call assert_equal('b4', -+ \ fnamemodify(getbufinfo({'bufloaded' : 1})[0].name, ':t')) -+ -+ %bwipe! -+ call delete('b1') -+ call delete('b2') -+ call delete('b3') -+ call delete('b4') -+endfunc -+ -+" vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-invalid-argument-errmsg.patch b/backport-invalid-argument-errmsg.patch deleted file mode 100644 index a3f1c977a573365d2cd21d6933f4f60f31918928..0000000000000000000000000000000000000000 --- a/backport-invalid-argument-errmsg.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 436b5adc9770a2568209dd5ab1f98bd1afc91898 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 31 Dec 2021 22:49:24 +0000 -Subject: [PATCH] patch 8.2.3961: error messages are spread out - -Problem: Error messages are spread out. -Solution: Move more errors to errors.h. - ---- - src/globals.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/globals.h b/src/globals.h -index 75092b7..45d9111 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1453,6 +1453,7 @@ EXTERN char e_abort[] INIT(= N_("E470: Command aborted")); - EXTERN char e_argreq[] INIT(= N_("E471: Argument required")); - EXTERN char e_cannot_change_arglist_recursively[] INIT(= N_("E1156: Cannot change the argument list recursively")); - EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &")); -+EXTERN char e_invalid_argument[] INIT(= N_("E474: Invalid argument")); - #ifdef FEAT_CMDWIN - EXTERN char e_cmdwin[] INIT(= N_("E11: Invalid in command-line window; executes, CTRL-C quits")); - #endif --- -2.27.0 - diff --git a/backport-invalid-memory-access-with-search-command.patch b/backport-invalid-memory-access-with-search-command.patch deleted file mode 100644 index 4f29f70dc8a87f15a6589a8199354f77ea1c20b7..0000000000000000000000000000000000000000 --- a/backport-invalid-memory-access-with-search-command.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 98a336dd497d3422e7efeef9f24cc9e25aeb8a49 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 20 Jan 2020 20:22:30 +0100 -Subject: [PATCH] patch 8.2.0133: invalid memory access with search command -Problem: Invalid memory access with search command. -Solution: When :normal runs out of characters in bracketed paste mode break - out of the loop.(closes #5511) -Reference:https://github.com/vim/vim/commit/98a336dd497d3422e7efeef9f24cc9e25aeb8a49 -Conflict:The src/version.c file is not modified. ---- - src/edit.c | 4 ++-- - src/testdir/test_search.vim | 5 +++++ - 2 files changed, 7 insertions(+), 2 deletions(-) -diff --git a/src/edit.c b/src/edit.c -index d2e45dd..f822a79 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -4959,9 +4959,9 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) - do - c = vgetc(); - while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); -- if (c == NUL || got_int) -+ if (c == NUL || got_int || (ex_normal_busy > 0 && c == Ctrl_C)) - // When CTRL-C was encountered the typeahead will be flushed and we -- // won't get the end sequence. -+ // won't get the end sequence. Except when using ":normal". - break; - - if (has_mbyte) -diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim -index 1876713..c8020eb 100644 ---- a/src/testdir/test_search.vim -+++ b/src/testdir/test_search.vim -@@ -1366,3 +1366,8 @@ func Test_searchdecl() - - bwipe! - endfunc -+ -+func Test_search_special() -+ " this was causing illegal memory access -+ exe "norm /\x80PS" -+endfunc --- -2.27.0 diff --git a/backport-memory-leak-for-retab-with-invalid-argument.patch b/backport-memory-leak-for-retab-with-invalid-argument.patch deleted file mode 100644 index fa19957dd33a9ef43fd38fe78125f76b5d466de6..0000000000000000000000000000000000000000 --- a/backport-memory-leak-for-retab-with-invalid-argument.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 2ddb89f8a94425cda1e5491efc80c1ccccb6e08e Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sat, 4 Sep 2021 21:20:41 +0200 -Subject: [PATCH] patch 8.2.3403: memory leak for :retab with invalid argument - -Problem: Memory leak for :retab with invalid argument. -Solution: Free the memory. Make error messages consistent. ---- - src/indent.c | 13 +++++++++++-- - src/version.c | 2 ++ - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/src/indent.c b/src/indent.c -index 7e196c2..7d04373 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -70,9 +70,12 @@ tabstop_set(char_u *var, int **array) - { - int n = atoi((char *)cp); - -+ // Catch negative values, overflow and ridiculous big values. - if (n < 0 || n > 9999) - { - semsg(_(e_invarg2), cp); -+ vim_free(*array); -+ *array = NULL; - return FAIL; - } - (*array)[t++] = n; -@@ -1580,12 +1583,18 @@ ex_retab(exarg_T *eap) - else - new_ts_str = vim_strnsave(new_ts_str, eap->arg - new_ts_str); - #else -- new_ts = getdigits(&(eap->arg)); -- if (new_ts < 0) -+ ptr = eap->arg; -+ new_ts = getdigits(&ptr); -+ if (new_ts < 0 && *eap->arg == '-') - { - emsg(_(e_positive)); - return; - } -+ if (new_ts < 0 || new_ts > 9999) -+ { -+ semsg(_(e_invarg2), eap->arg); -+ return; -+ } - if (new_ts == 0) - new_ts = curbuf->b_p_ts; - #endif -diff --git a/src/version.c b/src/version.c -index 8912f62..f8e4561 100644 ---- a/src/version.c -+++ b/src/version.c -@@ -743,6 +743,8 @@ static char *(features[]) = - static int included_patches[] = - { /* Add new patch number below this line */ - /**/ -+ 3403, -+/**/ - 3402, - /**/ - 0 --- -1.8.3.1 - diff --git a/backport-missing-error-message.patch b/backport-missing-error-message.patch deleted file mode 100644 index 72719e5444e42ce9bb5875da176ca76a89050d68..0000000000000000000000000000000000000000 --- a/backport-missing-error-message.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 61015162ba834541c42da5db6f3fa0ebe1d40e87 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 28 Jan 2021 17:56:09 +0100 -Subject: [PATCH] patch 8.2.2423: missing error message -Conflict:add missing error message -Reference:https://github.com/vim/vim/commit/61015162ba834541c42da5db6f3fa0ebe1d40e87 - -Problem: Missing error message. -Solution: Add the error message. - ---- - src/globals.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/globals.h b/src/globals.h -index 009834c..872e895 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1451,6 +1451,7 @@ EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer" - */ - EXTERN char e_abort[] INIT(= N_("E470: Command aborted")); - EXTERN char e_argreq[] INIT(= N_("E471: Argument required")); -+EXTERN char e_cannot_change_arglist_recursively[] INIT(= N_("E1156: Cannot change the argument list recursively")); - EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &")); - #ifdef FEAT_CMDWIN - EXTERN char e_cmdwin[] INIT(= N_("E11: Invalid in command-line window; executes, CTRL-C quits")); --- -2.27.0 - diff --git a/backport-no-early-check-if-find-and-sfind-have-an-argument.patch b/backport-no-early-check-if-find-and-sfind-have-an-argument.patch deleted file mode 100644 index 02934c578084bd63f76f6493f2e8902a8baf68e7..0000000000000000000000000000000000000000 --- a/backport-no-early-check-if-find-and-sfind-have-an-argument.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 2d10cd478047df8ba144d4b0fcc46480993af57f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 19 Mar 2020 14:37:30 +0100 -Subject: [PATCH] patch 8.2.0407: no early check if :find and :sfind have an - argument - -Problem: No early check if :find and :sfind have an argument. -Solution: Add EX_NEEDARG. - -Reference:https://github.com/vim/vim/commit/2d10cd478047df8ba144d4b0fcc46480993af57f ---- - src/ex_cmds.h | 4 ++-- - src/testdir/test_find_complete.vim | 8 ++++---- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/ex_cmds.h b/src/ex_cmds.h -index 983378c..28ea6ee 100644 ---- a/src/ex_cmds.h -+++ b/src/ex_cmds.h -@@ -572,7 +572,7 @@ EXCMD(CMD_filter, "filter", ex_wrongmodifier, - EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM, - ADDR_NONE), - EXCMD(CMD_find, "find", ex_find, -- EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR, -+ EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG, - ADDR_OTHER), - EXCMD(CMD_finally, "finally", ex_finally, - EX_TRLBAR|EX_SBOXOK|EX_CMDWIN, -@@ -1319,7 +1319,7 @@ EXCMD(CMD_setlocal, "setlocal", ex_set, - EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK, - ADDR_NONE), - EXCMD(CMD_sfind, "sfind", ex_splitview, -- EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR, -+ EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG, - ADDR_OTHER), - EXCMD(CMD_sfirst, "sfirst", ex_rewind, - EX_EXTRA|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR, -diff --git a/src/testdir/test_find_complete.vim b/src/testdir/test_find_complete.vim -index 679bf3c..32ca967 100644 ---- a/src/testdir/test_find_complete.vim -+++ b/src/testdir/test_find_complete.vim -@@ -15,22 +15,22 @@ func Test_find_complete() - - new - set path= -- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E345:') -+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:') - close - - new - set path=. -- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:') -+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:') - close - - new - set path=.,, -- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:') -+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:') - close - - new - set path=./** -- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:') -+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:') - close - - " We shouldn't find any file till this point --- -2.23.0 \ No newline at end of file diff --git a/backport-patch-8.2.0310-autocmd-test-fails-on-a-slow-system.patch b/backport-patch-8.2.0310-autocmd-test-fails-on-a-slow-system.patch deleted file mode 100644 index 0e1a44ab11153ba6006c1f4fa4d6a3096215d0db..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.0310-autocmd-test-fails-on-a-slow-system.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8fb1b47a5e24892b23c3923a07d8a850d99b14b2 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 23 Feb 2020 16:16:26 +0100 -Subject: [PATCH] patch 8.2.0310: autocmd test fails on a slow system - -Problem: Autocmd test fails on a slow system. -Solution: Adjust the expectations. (James McCoy, closes #5685) ---- - src/testdir/test_autocmd.vim | 12 +++++++----- - 1 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim -index 2ff231d..8a1d5d8 100644 ---- a/src/testdir/test_autocmd.vim -+++ b/src/testdir/test_autocmd.vim -@@ -2245,17 +2245,19 @@ func Test_autocmd_SafeState() - call writefile(lines, 'XSafeState') - let buf = RunVimInTerminal('-S XSafeState', #{rows: 6}) - -- " Sometimes we loop to handle an K_IGNORE -+ " Sometimes we loop to handle a K_IGNORE, SafeState may be trigered once or -+ " more often. - call term_sendkeys(buf, ":echo g:safe\") -- call WaitForAssert({-> assert_match('^[12] ', term_getline(buf, 6))}, 1000) -+ call WaitForAssert({-> assert_match('^\d ', term_getline(buf, 6))}, 1000) - -+ " SafeStateAgain should be invoked at least three times - call term_sendkeys(buf, ":echo g:again\") -- call WaitForAssert({-> assert_match('^xxxx', term_getline(buf, 6))}, 1000) -+ call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000) - - call term_sendkeys(buf, ":let g:again = ''\:call CallTimer()\") -- call term_wait(buf, 50) -+ call term_wait(buf, 100) - call term_sendkeys(buf, ":\") -- call term_wait(buf, 50) -+ call term_wait(buf, 100) - call term_sendkeys(buf, ":echo g:again\") - call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) - --- -1.8.3.1 - diff --git a/backport-patch-8.2.0358-insufficient-testing-for-indent.c.patch b/backport-patch-8.2.0358-insufficient-testing-for-indent.c.patch deleted file mode 100644 index b5d1b2832513788a4b5968f5e30925f2cc853179..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.0358-insufficient-testing-for-indent.c.patch +++ /dev/null @@ -1,275 +0,0 @@ -From bd7206e02c957f0619e68e1628e2a3e91dd41e06 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Fri, 6 Mar 2020 20:36:04 +0100 -Subject: [PATCH] patch 8.2.0358: insufficient testing for indent.c - -Problem: Insufficient testing for indent.c. -Solution: Add indent tests. (Yegappan Lakshmanan, closes #5736) ---- - src/testdir/Make_all.mak | 2 + - src/testdir/test_expand_func.vim | 14 ++++++ - src/testdir/test_indent.vim | 101 +++++++++++++++++++++++++++++++++++++++ - src/testdir/test_lispwords.vim | 3 ++ - src/testdir/test_smartindent.vim | 23 +++++++++ - src/testdir/test_vartabs.vim | 39 +++++++++++++++ - 6 files changed, 182 insertions(+) - create mode 100644 src/testdir/test_indent.vim - -diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak -index 2a3c4ab..4ecb606 100644 ---- a/src/testdir/Make_all.mak -+++ b/src/testdir/Make_all.mak -@@ -150,6 +150,7 @@ NEW_TESTS = \ - test_iminsert \ - test_increment \ - test_increment_dbcs \ -+ test_indent \ - test_ins_complete \ - test_interrupt \ - test_job_fails \ -@@ -361,6 +362,7 @@ NEW_TESTS_RES = \ - test_iminsert.res \ - test_increment.res \ - test_increment_dbcs.res \ -+ test_indent.res \ - test_ins_complete.res \ - test_interrupt.res \ - test_job_fails.res \ -diff --git a/src/testdir/test_expand_func.vim b/src/testdir/test_expand_func.vim -index f9c5b5f..c408dea 100644 ---- a/src/testdir/test_expand_func.vim -+++ b/src/testdir/test_expand_func.vim -@@ -73,3 +73,17 @@ func Test_expand() - " Don't add any line above this, otherwise will change. - quit - endfunc -+ -+" Test for 'wildignore' with expand() -+func Test_expand_wildignore() -+ set wildignore=*.vim -+ call assert_equal('', expand('test_expand_func.vim')) -+ call assert_equal('', expand('test_expand_func.vim', 0)) -+ call assert_equal([], expand('test_expand_func.vim', 0, 1)) -+ call assert_equal('test_expand_func.vim', expand('test_expand_func.vim', 1)) -+ call assert_equal(['test_expand_func.vim'], -+ \ expand('test_expand_func.vim', 1, 1)) -+ set wildignore& -+endfunc -+ -+" vim: shiftwidth=2 sts=2 expandtab -diff --git a/src/testdir/test_indent.vim b/src/testdir/test_indent.vim -new file mode 100644 -index 0000000..91e801a ---- /dev/null -+++ b/src/testdir/test_indent.vim -@@ -0,0 +1,101 @@ -+" Test for various indent options -+ -+func Test_preserveindent() -+ new -+ " Test for autoindent copying indent from the previous line -+ setlocal autoindent -+ call setline(1, [repeat(' ', 16) .. 'line1']) -+ call feedkeys("A\nline2", 'xt') -+ call assert_equal("\t\tline2", getline(2)) -+ setlocal autoindent& -+ -+ " Test for using CTRL-T with and without 'preserveindent' -+ set shiftwidth=4 -+ call cursor(1, 1) -+ call setline(1, " \t ") -+ call feedkeys("Al\", 'xt') -+ call assert_equal("\t\tl", getline(1)) -+ set preserveindent -+ call setline(1, " \t ") -+ call feedkeys("Al\", 'xt') -+ call assert_equal(" \t \tl", getline(1)) -+ set pi& sw& -+ -+ " Test for using CTRL-T with 'expandtab' and 'preserveindent' -+ call cursor(1, 1) -+ call setline(1, "\t \t") -+ set shiftwidth=4 expandtab preserveindent -+ call feedkeys("Al\", 'xt') -+ call assert_equal("\t \t l", getline(1)) -+ set sw& et& pi& -+ -+ close! -+endfunc -+ -+" Test for indent() -+func Test_indent_func() -+ call assert_equal(-1, indent(-1)) -+ new -+ call setline(1, "\tabc") -+ call assert_equal(8, indent(1)) -+ call setline(1, " abc") -+ call assert_equal(4, indent(1)) -+ call setline(1, " \t abc") -+ call assert_equal(12, indent(1)) -+ close! -+endfunc -+ -+" Test for reindenting a line using the '=' operator -+func Test_reindent() -+ new -+ call setline(1, 'abc') -+ set nomodifiable -+ call assert_fails('normal ==', 'E21:') -+ set modifiable -+ -+ call setline(1, ['foo', 'bar']) -+ call feedkeys('ggVG=', 'xt') -+ call assert_equal(['foo', 'bar'], getline(1, 2)) -+ close! -+endfunc -+ -+" Test for shifting a line with a preprocessor directive ('#') -+func Test_preproc_indent() -+ new -+ set sw=4 -+ call setline(1, '#define FOO 1') -+ normal >> -+ call assert_equal(' #define FOO 1', getline(1)) -+ -+ " with 'smartindent' -+ call setline(1, '#define FOO 1') -+ set smartindent -+ normal >> -+ call assert_equal('#define FOO 1', getline(1)) -+ set smartindent& -+ -+ " with 'cindent' -+ set cindent -+ normal >> -+ call assert_equal('#define FOO 1', getline(1)) -+ set cindent& -+ -+ close! -+endfunc -+ -+" Test for 'copyindent' -+func Test_copyindent() -+ new -+ set shiftwidth=4 autoindent expandtab copyindent -+ call setline(1, " \t abc") -+ call feedkeys("ol", 'xt') -+ call assert_equal(" \t l", getline(2)) -+ set noexpandtab -+ call setline(1, " \t abc") -+ call feedkeys("ol", 'xt') -+ call assert_equal(" \t l", getline(2)) -+ set sw& ai& et& ci& -+ close! -+endfunc -+ -+" vim: shiftwidth=2 sts=2 expandtab -diff --git a/src/testdir/test_lispwords.vim b/src/testdir/test_lispwords.vim -index aa5a738..ff710b2 100644 ---- a/src/testdir/test_lispwords.vim -+++ b/src/testdir/test_lispwords.vim -@@ -45,6 +45,7 @@ func Test_lisp_indent() - \ ]) - call assert_equal(7, lispindent(2)) - call assert_equal(5, 6->lispindent()) -+ call assert_equal(-1, lispindent(-1)) - - set lisp - set lispwords& -@@ -83,3 +84,5 @@ func Test_lisp_indent() - let &cpoptions=save_copt - set nolisp - endfunc -+ -+" vim: shiftwidth=2 sts=2 expandtab -diff --git a/src/testdir/test_smartindent.vim b/src/testdir/test_smartindent.vim -index e89ad19..dc0f99e 100644 ---- a/src/testdir/test_smartindent.vim -+++ b/src/testdir/test_smartindent.vim -@@ -38,4 +38,27 @@ func Test_smartindent_has_no_effect() - bwipe! - endfunc - -+" Test for inserting '{' and '} with smartindent -+func Test_smartindent_braces() -+ new -+ set smartindent shiftwidth=4 -+ call setline(1, [' if (a)', "\tif (b)", "\t return 1"]) -+ normal 2ggO{ -+ normal 3ggA { -+ normal 4ggo} -+ normal o} -+ normal 4ggO#define FOO 1 -+ call assert_equal([ -+ \ ' if (a)', -+ \ ' {', -+ \ "\tif (b) {", -+ \ '#define FOO 1', -+ \ "\t return 1", -+ \ "\t}", -+ \ ' }' -+ \ ], getline(1, '$')) -+ set si& sw& ai& -+ close! -+endfunc -+ - " vim: shiftwidth=2 sts=2 expandtab -diff --git a/src/testdir/test_vartabs.vim b/src/testdir/test_vartabs.vim -index c2919d8..0ac6ad2 100644 ---- a/src/testdir/test_vartabs.vim -+++ b/src/testdir/test_vartabs.vim -@@ -91,6 +91,18 @@ func Test_vartabs() - let expect = "l\ l\l l\ l\ l" - call assert_equal(expect, getline(1)) - -+ " Test for 'retab' with vts -+ set ts=8 sts=0 vts=5,3,6,2 vsts= -+ exe "norm! S l" -+ .retab! -+ call assert_equal("\t\t\t\tl", getline(1)) -+ -+ " Test for 'retab' with same vlaues as vts -+ set ts=8 sts=0 vts=5,3,6,2 vsts= -+ exe "norm! S l" -+ .retab! 5,3,6,2 -+ call assert_equal("\t\t\t\tl", getline(1)) -+ - " Check that global and local values are set. - set ts=4 vts=6 sts=8 vsts=10 - call assert_equal(&ts, 4) -@@ -390,5 +402,32 @@ func Test_vartabstop_latin1() - let &encoding = save_encoding - endfunc - -+func s:SaveCol(l) -+ call add(a:l, [col('.'), virtcol('.')]) -+ return '' -+endfunc -+ -+" Test for 'varsofttabstop' -+func Test_varsofttabstop() -+ new -+ inoremap s:SaveCol(g:cols) -+ -+ set backspace=indent,eol,start -+ set varsofttabstop=6,2,5,3 -+ let g:cols = [] -+ call feedkeys("a\t\\t\\t\\t\ ", 'xt') -+ call assert_equal("\t\t ", getline(1)) -+ call assert_equal([[7, 7], [2, 9], [7, 14], [3, 17]], g:cols) -+ -+ let g:cols = [] -+ call feedkeys("a\\\\\\\\\\", 'xt') -+ call assert_equal('', getline(1)) -+ call assert_equal([[3, 17], [7, 14], [2, 9], [7, 7], [1, 1]], g:cols) -+ -+ set varsofttabstop& -+ set backspace& -+ iunmap -+ close! -+endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-patch-8.2.0614-get-ml_get-error-when-deleting-a-line.patch b/backport-patch-8.2.0614-get-ml_get-error-when-deleting-a-line.patch deleted file mode 100644 index 5f33ba7737146985a11c69105d16cb63c6ab649f..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.0614-get-ml_get-error-when-deleting-a-line.patch +++ /dev/null @@ -1,242 +0,0 @@ -From ff06f283e3e4b3ec43012dd3b83f8454c98f6639 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Tue, 21 Apr 2020 22:01:14 +0200 -Subject: [PATCH] patch 8.2.0614: get ml_get error when deleting a line in - 'completefunc' - -Problem: Get ml_get error when deleting a line in 'completefunc'. (Yegappan - Lakshmanan) -Solution: Lock the text while evaluating 'completefunc'. ---- - runtime/doc/insert.txt | 6 ++++-- - src/edit.c | 10 ++-------- - src/ex_getln.c | 2 +- - src/globals.h | 5 +++-- - src/insexpand.c | 22 ++++++++++++++-------- - src/testdir/test_edit.vim | 21 +++++++++++++++++++-- - src/testdir/test_popup.vim | 10 ++++------ - src/undo.c | 2 +- - 8 files changed, 48 insertions(+), 30 deletions(-) - -diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt -index 99c2d40..ff74d62 100644 ---- a/runtime/doc/insert.txt -+++ b/runtime/doc/insert.txt -@@ -666,8 +666,10 @@ Note: The keys that are valid in CTRL-X mode are not mapped. This allows for - ends CTRL-X mode (any key that is not a valid CTRL-X mode command) is mapped. - Also, when doing completion with 'complete' mappings apply as usual. - --Note: While completion is active Insert mode can't be used recursively. --Mappings that somehow invoke ":normal i.." will generate an E523 error. -+ *E565* -+Note: While completion is active Insert mode can't be used recursively and -+buffer text cannot be changed. Mappings that somehow invoke ":normal i.." -+will generate an E565 error. - - The following mappings are suggested to make typing the completion commands - a bit easier (although they will hide other commands): > -diff --git a/src/edit.c b/src/edit.c -index 3f0803f..05518ce 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -175,16 +175,10 @@ edit( - #endif - // Don't allow changes in the buffer while editing the cmdline. The - // caller of getcmdline() may get confused. -- if (textlock != 0) -- { -- emsg(_(e_secure)); -- return FALSE; -- } -- - // Don't allow recursive insert mode when busy with completion. -- if (ins_compl_active() || compl_busy || pum_visible()) -+ if (textlock != 0 || ins_compl_active() || compl_busy || pum_visible()) - { -- emsg(_(e_secure)); -+ emsg(_(e_textlock)); - return FALSE; - } - ins_compl_clear(); // clear stuff for CTRL-X mode -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 9b959fb..18da926 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -2576,7 +2576,7 @@ get_text_locked_msg(void) - if (cmdwin_type != 0) - return e_cmdwin; - #endif -- return e_secure; -+ return e_textlock; - } - - /* -diff --git a/src/globals.h b/src/globals.h -index 4822bf3..f6c9d60 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -1678,9 +1678,10 @@ EXTERN char e_letunexp[] INIT(= N_("E18: Unexpected characters in :let")); - EXTERN char e_readerrf[] INIT(= N_("E47: Error while reading errorfile")); - #endif - #ifdef HAVE_SANDBOX --EXTERN char e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); -+EXTERN char e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); - #endif --EXTERN char e_secure[] INIT(= N_("E523: Not allowed here")); -+EXTERN char e_secure[] INIT(= N_("E523: Not allowed here")); -+EXTERN char e_textlock[] INIT(= N_("E565: Not allowed to change text here")); - #if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \ - || defined(UNIX) || defined(VMS) - EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported")); -diff --git a/src/insexpand.c b/src/insexpand.c -index 0278522..48ab260 100644 ---- a/src/insexpand.c -+++ b/src/insexpand.c -@@ -2217,6 +2217,8 @@ expand_by_function( - pos = curwin->w_cursor; - curwin_save = curwin; - curbuf_save = curbuf; -+ // Lock the text to avoid weird things from happening. -+ ++textlock; - - // Call a function, which returns a list or dict. - if (call_vim_function(funcname, 2, args, &rettv) == OK) -@@ -2239,6 +2241,7 @@ expand_by_function( - break; - } - } -+ --textlock; - - if (curwin_save != curwin || curbuf_save != curbuf) - { -@@ -2431,6 +2434,7 @@ set_completion(colnr_T startcol, list_T *list) - f_complete(typval_T *argvars, typval_T *rettv UNUSED) - { - int startcol; -+ int save_textlock = textlock; - - if ((State & INSERT) == 0) - { -@@ -2438,22 +2442,24 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) - return; - } - -+ // "textlock" is set when evaluating 'completefunc' but we can change text -+ // here. -+ textlock = 0; -+ - // Check for undo allowed here, because if something was already inserted - // the line was already saved for undo and this check isn't done. - if (!undo_allowed()) - return; - - if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) -- { - emsg(_(e_invarg)); -- return; -+ else -+ { -+ startcol = (int)tv_get_number_chk(&argvars[0], NULL); -+ if (startcol > 0) -+ set_completion(startcol - 1, argvars[1].vval.v_list); - } -- -- startcol = (int)tv_get_number_chk(&argvars[0], NULL); -- if (startcol <= 0) -- return; -- -- set_completion(startcol - 1, argvars[1].vval.v_list); -+ textlock = save_textlock; - } - - /* -diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim -index 9096fcd..ce55f6b 100644 ---- a/src/testdir/test_edit.vim -+++ b/src/testdir/test_edit.vim -@@ -915,6 +915,23 @@ func Test_edit_CTRL_U() - bw! - endfunc - -+func Test_edit_completefunc_delete() -+ func CompleteFunc(findstart, base) -+ if a:findstart == 1 -+ return col('.') - 1 -+ endif -+ normal dd -+ return ['a', 'b'] -+ endfunc -+ new -+ set completefunc=CompleteFunc -+ call setline(1, ['', 'abcd', '']) -+ 2d -+ call assert_fails("normal 2G$a\\", 'E565:') -+ bwipe! -+endfunc -+ -+ - func Test_edit_CTRL_Z() - " Ctrl-Z when insertmode is not set inserts it literally - new -@@ -1240,7 +1257,7 @@ func Test_edit_forbidden() - try - call feedkeys("ix\", 'tnix') - call assert_fails(1, 'textlock') -- catch /^Vim\%((\a\+)\)\=:E523/ " catch E523: not allowed here -+ catch /^Vim\%((\a\+)\)\=:E565/ " catch E565: not allowed here - endtry - " TODO: Might be a bug: should x really be inserted here - call assert_equal(['xa'], getline(1, '$')) -@@ -1264,7 +1281,7 @@ func Test_edit_forbidden() - try - call feedkeys("i\\\", 'tnix') - call assert_fails(1, 'change in complete function') -- catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 -+ catch /^Vim\%((\a\+)\)\=:E565/ " catch E565 - endtry - delfu Complete - set completefunc= -diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim -index e96d5fd..9890377 100644 ---- a/src/testdir/test_popup.vim -+++ b/src/testdir/test_popup.vim -@@ -334,19 +334,17 @@ func DummyCompleteOne(findstart, base) - endif - endfunc - --" Test that nothing happens if the 'completefunc' opens --" a new window (no completion, no crash) -+" Test that nothing happens if the 'completefunc' tries to open -+" a new window (fails to open window, continues) - func Test_completefunc_opens_new_window_one() - new - let winid = win_getid() - setlocal completefunc=DummyCompleteOne - call setline(1, 'one') - /^one -- call assert_fails('call feedkeys("A\\\\", "x")', 'E839:') -- call assert_notequal(winid, win_getid()) -- q! -+ call assert_fails('call feedkeys("A\\\\", "x")', 'E565:') - call assert_equal(winid, win_getid()) -- call assert_equal('', getline(1)) -+ call assert_equal('oneDEF', getline(1)) - q! - endfunc - -diff --git a/src/undo.c b/src/undo.c -index c5ce306..c11b048 100644 ---- a/src/undo.c -+++ b/src/undo.c -@@ -333,7 +333,7 @@ undo_allowed(void) - // caller of getcmdline() may get confused. - if (textlock != 0) - { -- emsg(_(e_secure)); -+ emsg(_(e_textlock)); - return FALSE; - } - --- -1.8.3.1 - diff --git a/backport-patch-8.2.0670-cannot-change-window-when-evaluating-.patch b/backport-patch-8.2.0670-cannot-change-window-when-evaluating-.patch deleted file mode 100644 index c0a97aaf1c7800df5cf76b2a6eec59edf693d7dd..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.0670-cannot-change-window-when-evaluating-.patch +++ /dev/null @@ -1,443 +0,0 @@ -From 6adb9ea0a6ca01414f4b591f379b0f829a8273c0 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 30 Apr 2020 22:31:18 +0200 -Subject: [PATCH] patch 8.2.0670: cannot change window when evaluating - 'completefunc' - -Problem: Cannot change window when evaluating 'completefunc'. -Solution: Make a difference between not changing text or buffers and also - not changing window. ---- - src/beval.c | 4 ++-- - src/change.c | 4 ++-- - src/edit.c | 9 +++++---- - src/eval.c | 10 +++++----- - src/ex_docmd.c | 2 +- - src/ex_getln.c | 30 +++++++++++++++++++++--------- - src/globals.h | 13 ++++++++++--- - src/indent.c | 4 ++-- - src/insexpand.c | 11 ++++++----- - src/map.c | 4 ++-- - src/proto/ex_getln.pro | 3 ++- - src/register.c | 4 ++-- - src/testdir/test_edit.vim | 2 +- - src/testdir/test_popup.vim | 2 +- - src/undo.c | 2 +- - src/window.c | 2 +- - 16 files changed, 64 insertions(+), 42 deletions(-) - -diff --git a/src/beval.c b/src/beval.c -index 6b10a65..b7d9226 100644 ---- a/src/beval.c -+++ b/src/beval.c -@@ -282,7 +282,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) - curbuf = save_curbuf; - if (use_sandbox) - ++sandbox; -- ++textlock; -+ ++textwinlock; - - vim_free(result); - result = eval_to_string(bexpr, NULL, TRUE); -@@ -299,7 +299,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED) - - if (use_sandbox) - --sandbox; -- --textlock; -+ --textwinlock; - - set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); - if (result != NULL && result[0] != NUL) -diff --git a/src/change.c b/src/change.c -index cfba90b..45d6704 100644 ---- a/src/change.c -+++ b/src/change.c -@@ -382,7 +382,7 @@ invoke_listeners(buf_T *buf) - - argv[4].v_type = VAR_LIST; - argv[4].vval.v_list = buf->b_recorded_changes; -- ++textlock; -+ ++textwinlock; - - for (lnr = buf->b_listener; lnr != NULL; lnr = lnr->lr_next) - { -@@ -390,7 +390,7 @@ invoke_listeners(buf_T *buf) - clear_tv(&rettv); - } - -- --textlock; -+ --textwinlock; - list_unref(buf->b_recorded_changes); - buf->b_recorded_changes = NULL; - -diff --git a/src/edit.c b/src/edit.c -index 7f4f765..0ac63ec 100644 ---- a/src/edit.c -+++ b/src/edit.c -@@ -176,9 +176,10 @@ edit( - // Don't allow changes in the buffer while editing the cmdline. The - // caller of getcmdline() may get confused. - // Don't allow recursive insert mode when busy with completion. -- if (textlock != 0 || ins_compl_active() || compl_busy || pum_visible()) -+ if (textwinlock != 0 || textlock != 0 -+ || ins_compl_active() || compl_busy || pum_visible()) - { -- emsg(_(e_textlock)); -+ emsg(_(e_textwinlock)); - return FALSE; - } - ins_compl_clear(); // clear stuff for CTRL-X mode -@@ -5944,7 +5945,7 @@ do_insert_char_pre(int c) - } - - // Lock the text to avoid weird things from happening. -- ++textlock; -+ ++textwinlock; - set_vim_var_string(VV_CHAR, buf, -1); // set v:char - - res = NULL; -@@ -5958,7 +5959,7 @@ do_insert_char_pre(int c) - } - - set_vim_var_string(VV_CHAR, NULL, -1); // clear v:char -- --textlock; -+ --textwinlock; - - // Restore the State, it may have been changed. - State = save_State; -diff --git a/src/eval.c b/src/eval.c -index 4bd45e9..31dde2f 100644 ---- a/src/eval.c -+++ b/src/eval.c -@@ -393,7 +393,7 @@ eval_to_string( - - /* - * Call eval_to_string() without using current local variables and using -- * textlock. When "use_sandbox" is TRUE use the sandbox. -+ * textwinlock. When "use_sandbox" is TRUE use the sandbox. - */ - char_u * - eval_to_string_safe( -@@ -407,11 +407,11 @@ eval_to_string_safe( - save_funccal(&funccal_entry); - if (use_sandbox) - ++sandbox; -- ++textlock; -+ ++textwinlock; - retval = eval_to_string(arg, nextcmd, FALSE); - if (use_sandbox) - --sandbox; -- --textlock; -+ --textwinlock; - restore_funccal(); - return retval; - } -@@ -576,7 +576,7 @@ eval_foldexpr(char_u *arg, int *cp) - ++emsg_off; - if (use_sandbox) - ++sandbox; -- ++textlock; -+ ++textwinlock; - *cp = NUL; - if (eval0(arg, &tv, NULL, TRUE) == FAIL) - retval = 0; -@@ -601,7 +601,7 @@ eval_foldexpr(char_u *arg, int *cp) - --emsg_off; - if (use_sandbox) - --sandbox; -- --textlock; -+ --textwinlock; - - return (int)retval; - } -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index ca69c29..65ef936 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -5749,7 +5749,7 @@ handle_drop( - handle_any_postponed_drop(void) - { - if (!drop_busy && drop_filev != NULL -- && !text_locked() && !curbuf_locked() && !updating_screen) -+ && !text_locked() && !curbuf_locked() && !updating_screen) - handle_drop_internal(); - } - #endif -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 6376a5f..48d40cf 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -1318,12 +1318,12 @@ getcmdline_int( - c = get_expr_register(); - if (c == '=') - { -- // Need to save and restore ccline. And set "textlock" -+ // Need to save and restore ccline. And set "textwinlock" - // to avoid nasty things like going to another buffer when - // evaluating an expression. -- ++textlock; -+ ++textwinlock; - p = get_expr_line(); -- --textlock; -+ --textwinlock; - - if (p != NULL) - { -@@ -2548,17 +2548,17 @@ check_opt_wim(void) - - /* - * Return TRUE when the text must not be changed and we can't switch to -- * another window or buffer. Used when editing the command line, evaluating -+ * another window or buffer. TRUE when editing the command line, evaluating - * 'balloonexpr', etc. - */ - int --text_locked(void) -+text_and_win_locked(void) - { - #ifdef FEAT_CMDWIN - if (cmdwin_type != 0) - return TRUE; - #endif -- return textlock != 0; -+ return textwinlock != 0; - } - - /* -@@ -2578,10 +2578,22 @@ get_text_locked_msg(void) - if (cmdwin_type != 0) - return e_cmdwin; - #endif -+ if (textwinlock != 0) -+ return e_textwinlock; - return e_textlock; - } - - /* -+ * Return TRUE when the text must not be changed and/or we cannot switch to -+ * another window. TRUE while evaluating 'completefunc'. -+ */ -+ int -+text_locked(void) -+{ -+ return text_and_win_locked() || textlock != 0; -+} -+ -+/* - * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is - * and give an error message. - */ -@@ -3560,11 +3572,11 @@ cmdline_paste( - regname = may_get_selection(regname); - #endif - -- // Need to set "textlock" to avoid nasty things like going to another -+ // Need to set "textwinlock" to avoid nasty things like going to another - // buffer when evaluating an expression. -- ++textlock; -+ ++textwinlock; - i = get_spec_reg(regname, &arg, &allocated, TRUE); -- --textlock; -+ --textwinlock; - - if (i) - { -diff --git a/src/globals.h b/src/globals.h -index 2dceab5..9180bef 100644 ---- a/src/globals.h -+++ b/src/globals.h -@@ -798,9 +798,15 @@ EXTERN int secure INIT(= FALSE); - // allowed, e.g. when sourcing .exrc or .vimrc - // in current directory - --EXTERN int textlock INIT(= 0); -+EXTERN int textwinlock INIT(= 0); - // non-zero when changing text and jumping to -- // another window or buffer is not allowed -+ // another window or editing another buffer is -+ // not allowed -+ -+EXTERN int textlock INIT(= 0); -+ // non-zero when changing text is not allowed, -+ // jumping to another window is allowed, -+ // editing another buffer is not allowed. - - EXTERN int curbuf_lock INIT(= 0); - // non-zero when the current buffer can't be -@@ -1681,7 +1687,8 @@ EXTERN char e_readerrf[] INIT(= N_("E47: Error while reading errorfile")); - EXTERN char e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); - #endif - EXTERN char e_secure[] INIT(= N_("E523: Not allowed here")); --EXTERN char e_textlock[] INIT(= N_("E565: Not allowed to change text here")); -+EXTERN char e_textlock[] INIT(= N_("E578: Not allowed to change text here")); -+EXTERN char e_textwinlock[] INIT(= N_("E565: Not allowed to change text or change window")); - #if defined(AMIGA) || defined(MACOS_X) || defined(MSWIN) \ - || defined(UNIX) || defined(VMS) - EXTERN char e_screenmode[] INIT(= N_("E359: Screen mode setting not supported")); -diff --git a/src/indent.c b/src/indent.c -index 10c82d8..a1d4d36 100644 ---- a/src/indent.c -+++ b/src/indent.c -@@ -1760,7 +1760,7 @@ get_expr_indent(void) - set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum); - if (use_sandbox) - ++sandbox; -- ++textlock; -+ ++textwinlock; - - // Need to make a copy, the 'indentexpr' option could be changed while - // evaluating it. -@@ -1773,7 +1773,7 @@ get_expr_indent(void) - - if (use_sandbox) - --sandbox; -- --textlock; -+ --textwinlock; - - // Restore the cursor position so that 'indentexpr' doesn't need to. - // Pretend to be in Insert mode, allow cursor past end of line for "o" -diff --git a/src/insexpand.c b/src/insexpand.c -index 48ab260..bd809b0 100644 ---- a/src/insexpand.c -+++ b/src/insexpand.c -@@ -989,9 +989,9 @@ trigger_complete_changed_event(int cur) - dict_set_items_ro(v_event); - - recursive = TRUE; -- textlock++; -+ textwinlock++; - apply_autocmds(EVENT_COMPLETECHANGED, NULL, NULL, FALSE, curbuf); -- textlock--; -+ textwinlock--; - recursive = FALSE; - - dict_free_contents(v_event); -@@ -2217,7 +2217,8 @@ expand_by_function( - pos = curwin->w_cursor; - curwin_save = curwin; - curbuf_save = curbuf; -- // Lock the text to avoid weird things from happening. -+ // Lock the text to avoid weird things from happening. Do allow switching -+ // to another window temporarily. - ++textlock; - - // Call a function, which returns a list or dict. -@@ -2442,8 +2443,8 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) - return; - } - -- // "textlock" is set when evaluating 'completefunc' but we can change text -- // here. -+ // "textlock" is set when evaluating 'completefunc' but we can change -+ // text here. - textlock = 0; - - // Check for undo allowed here, because if something was already inserted -diff --git a/src/map.c b/src/map.c -index 85c46a5..2e20d40 100644 ---- a/src/map.c -+++ b/src/map.c -@@ -1570,14 +1570,14 @@ eval_map_expr( - - // Forbid changing text or using ":normal" to avoid most of the bad side - // effects. Also restore the cursor position. -- ++textlock; -+ ++textwinlock; - ++ex_normal_lock; - set_vim_var_char(c); // set v:char to the typed character - save_cursor = curwin->w_cursor; - save_msg_col = msg_col; - save_msg_row = msg_row; - p = eval_to_string(expr, NULL, FALSE); -- --textlock; -+ --textwinlock; - --ex_normal_lock; - curwin->w_cursor = save_cursor; - msg_col = save_msg_col; -diff --git a/src/proto/ex_getln.pro b/src/proto/ex_getln.pro -index a8ca7af..f64bb1f 100644 ---- a/src/proto/ex_getln.pro -+++ b/src/proto/ex_getln.pro -@@ -3,9 +3,10 @@ void cmdline_init(void); - char_u *getcmdline(int firstc, long count, int indent, int do_concat); - char_u *getcmdline_prompt(int firstc, char_u *prompt, int attr, int xp_context, char_u *xp_arg); - int check_opt_wim(void); --int text_locked(void); -+int text_and_win_locked(void); - void text_locked_msg(void); - char *get_text_locked_msg(void); -+int text_locked(void); - int curbuf_locked(void); - int allbuf_locked(void); - char_u *getexline(int c, void *cookie, int indent, int do_concat); -diff --git a/src/register.c b/src/register.c -index 2ad136b..e56149f 100644 ---- a/src/register.c -+++ b/src/register.c -@@ -932,9 +932,9 @@ yank_do_autocmd(oparg_T *oap, yankreg_T *reg) - dict_set_items_ro(v_event); - - recursive = TRUE; -- textlock++; -+ textwinlock++; - apply_autocmds(EVENT_TEXTYANKPOST, NULL, NULL, FALSE, curbuf); -- textlock--; -+ textwinlock--; - recursive = FALSE; - - // Empty the dictionary, v:event is still valid -diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim -index a9ba31d..f0bf5cc 100644 ---- a/src/testdir/test_edit.vim -+++ b/src/testdir/test_edit.vim -@@ -927,7 +927,7 @@ func Test_edit_completefunc_delete() - set completefunc=CompleteFunc - call setline(1, ['', 'abcd', '']) - 2d -- call assert_fails("normal 2G$a\\", 'E565:') -+ call assert_fails("normal 2G$a\\", 'E578:') - bwipe! - endfunc - -diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim -index 9890377..c7229fc 100644 ---- a/src/testdir/test_popup.vim -+++ b/src/testdir/test_popup.vim -@@ -342,7 +342,7 @@ func Test_completefunc_opens_new_window_one() - setlocal completefunc=DummyCompleteOne - call setline(1, 'one') - /^one -- call assert_fails('call feedkeys("A\\\\", "x")', 'E565:') -+ call assert_fails('call feedkeys("A\\\\", "x")', 'E578:') - call assert_equal(winid, win_getid()) - call assert_equal('oneDEF', getline(1)) - q! -diff --git a/src/undo.c b/src/undo.c -index c11b048..4bbc0af 100644 ---- a/src/undo.c -+++ b/src/undo.c -@@ -331,7 +331,7 @@ undo_allowed(void) - - // Don't allow changes in the buffer while editing the cmdline. The - // caller of getcmdline() may get confused. -- if (textlock != 0) -+ if (textwinlock != 0 || textlock != 0) - { - emsg(_(e_textlock)); - return FALSE; -diff --git a/src/window.c b/src/window.c -index 7c18c06..532d314 100644 ---- a/src/window.c -+++ b/src/window.c -@@ -4370,7 +4370,7 @@ win_goto(win_T *wp) - - if (ERROR_IF_POPUP_WINDOW) - return; -- if (text_locked()) -+ if (text_and_win_locked()) - { - beep_flush(); - text_locked_msg(); --- -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 deleted file mode 100644 index 84112b9560b0e0abe093c2584fec7e1122c8e8c9..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.1354-test-59-is-old-style.patch +++ /dev/null @@ -1,1813 +0,0 @@ -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.1677-memory-access-errors-when-calling-set.patch b/backport-patch-8.2.1677-memory-access-errors-when-calling-set.patch deleted file mode 100644 index 26098b5750220bfaf2ace6abe114e391157f62c8..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.1677-memory-access-errors-when-calling-set.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 4d170af0a9379da64d67dc3fa7cc7297956c6f52 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 13 Sep 2020 22:21:22 +0200 -Subject: [PATCH] patch 8.2.1677: memory access errors when calling - setloclist() in autocommand - -Problem: Memory access errors when calling setloclist() in an autocommand. -Solution: Give an error if the list was changed unexpectedly. (closes #6946) ---- - src/quickfix.c | 41 ++++++++++++++++++++++++++++++----- - src/testdir/test_quickfix.vim | 24 ++++++++++++++++++++ - 2 files changed, 60 insertions(+), 5 deletions(-) - -diff --git a/src/quickfix.c b/src/quickfix.c -index 206e901..a88475b 100644 ---- a/src/quickfix.c -+++ b/src/quickfix.c -@@ -211,7 +211,9 @@ static char_u *e_no_more_items = (char_u *)N_("E553: No more items"); - static char_u *qf_last_bufname = NULL; - static bufref_T qf_last_bufref = {NULL, 0, 0}; - --static char *e_loc_list_changed = -+static char *e_current_quickfix_list_was_changed = -+ N_("E925: Current quickfix list was changed"); -+static char *e_current_location_list_was_changed = - N_("E926: Current location list was changed"); - - /* -@@ -3109,6 +3111,7 @@ qf_jump_edit_buffer( - int *opened_window) - { - qf_list_T *qfl = qf_get_curlist(qi); -+ int old_changedtick = qfl->qf_changedtick; - qfltype_T qfl_type = qfl->qfl_type; - int retval = OK; - int old_qf_curlist = qi->qf_curlist; -@@ -3147,17 +3150,20 @@ qf_jump_edit_buffer( - - if (qfl_type == QFLT_QUICKFIX && !qflist_valid(NULL, save_qfid)) - { -- emsg(_("E925: Current quickfix was changed")); -+ emsg(_(e_current_quickfix_list_was_changed)); - return NOTDONE; - } - -+ // Check if the list was changed. The pointers may happen to be identical, -+ // thus also check qf_changedtick. - if (old_qf_curlist != qi->qf_curlist -+ || old_changedtick != qfl->qf_changedtick - || !is_qf_entry_present(qfl, qf_ptr)) - { - if (qfl_type == QFLT_QUICKFIX) -- emsg(_("E925: Current quickfix was changed")); -+ emsg(_(e_current_quickfix_list_was_changed)); - else -- emsg(_(e_loc_list_changed)); -+ emsg(_(e_current_location_list_was_changed)); - return NOTDONE; - } - -@@ -3265,10 +3271,25 @@ qf_jump_open_window( - int newwin, - int *opened_window) - { -+ qf_list_T *qfl = qf_get_curlist(qi); -+ int old_changedtick = qfl->qf_changedtick; -+ int old_qf_curlist = qi->qf_curlist; -+ qfltype_T qfl_type = qfl->qfl_type; -+ - // For ":helpgrep" find a help window or open one. - if (qf_ptr->qf_type == 1 && (!bt_help(curwin->w_buffer) || cmdmod.tab != 0)) - if (jump_to_help_window(qi, newwin, opened_window) == FAIL) - return FAIL; -+ if (old_qf_curlist != qi->qf_curlist -+ || old_changedtick != qfl->qf_changedtick -+ || !is_qf_entry_present(qfl, qf_ptr)) -+ { -+ if (qfl_type == QFLT_QUICKFIX) -+ emsg(_(e_current_quickfix_list_was_changed)); -+ else -+ emsg(_(e_current_location_list_was_changed)); -+ return FAIL; -+ } - - // If currently in the quickfix window, find another window to show the - // file in. -@@ -3283,6 +3304,16 @@ qf_jump_open_window( - opened_window) == FAIL) - return FAIL; - } -+ if (old_qf_curlist != qi->qf_curlist -+ || old_changedtick != qfl->qf_changedtick -+ || !is_qf_entry_present(qfl, qf_ptr)) -+ { -+ if (qfl_type == QFLT_QUICKFIX) -+ emsg(_(e_current_quickfix_list_was_changed)); -+ else -+ emsg(_(e_current_location_list_was_changed)); -+ return FAIL; -+ } - - return OK; - } -@@ -5697,7 +5728,7 @@ vgr_qflist_valid( - if (wp != NULL) - { - // An autocmd has freed the location list. -- emsg(_(e_loc_list_changed)); -+ emsg(_(e_current_location_list_was_changed)); - return FALSE; - } - else -diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim -index 72f3172..c6c0f28 100644 ---- a/src/testdir/test_quickfix.vim -+++ b/src/testdir/test_quickfix.vim -@@ -1401,6 +1401,30 @@ func Test_quickfix_was_changed_by_autocmd() - call XquickfixChangedByAutocmd('l') - endfunc - -+func Test_setloclist_in_autocommand() -+ call writefile(['test1', 'test2'], 'Xfile') -+ edit Xfile -+ let s:bufnr = bufnr() -+ call setloclist(1, -+ \ [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'}, -+ \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}]) -+ -+ augroup Test_LocList -+ au! -+ autocmd BufEnter * call setloclist(1, -+ \ [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'}, -+ \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}], 'r') -+ augroup END -+ -+ lopen -+ call assert_fails('exe "normal j\"', 'E926:') -+ -+ augroup Test_LocList -+ au! -+ augroup END -+ call delete('Xfile') -+endfunc -+ - func Test_caddbuffer_to_empty() - helpgr quickfix - call setqflist([], 'r') --- -2.27.0 - 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 deleted file mode 100644 index ee5073c283edabb716f0e34a17afc5f7996da6f7..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.3484-crash-when-going-through-spell-sugges.patch +++ /dev/null @@ -1,72 +0,0 @@ -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.3953-insert-completion-code-is-too-complic.patch b/backport-patch-8.2.3953-insert-completion-code-is-too-complic.patch deleted file mode 100644 index 19d48a28a985f9bc1010718536a2866bb933f3ff..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.3953-insert-completion-code-is-too-complic.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 6ad84ab3e48d9490e4139df04f2c55b136f5501d Mon Sep 17 00:00:00 2001 -From: Yegappan Lakshmanan -Date: Fri, 31 Dec 2021 12:59:53 +0000 -Subject: [PATCH] patch 8.2.3953: insert completion code is too complicated - -Problem: Insert completion code is too complicated. -Solution: More refactoring. Move function arguments into a struct. -(Yegappan Lakshmanan, closes #9437) ---- - src/insexpand.c | 196 +++++++++++++++++++++++++++++++------------------------- - 1 file changed, 107 insertions(+), 89 deletions(-) - -diff --git a/src/insexpand.c b/src/insexpand.c -index 66a836e..3b4d530 100644 ---- a/src/insexpand.c -+++ b/src/insexpand.c -@@ -407,6 +407,111 @@ ins_compl_accept_char(int c) - } - - /* -+ * Get the completed text by inferring the case of the originally typed text. -+ */ -+ static char_u * -+ins_compl_infercase_gettext( -+ char_u *str, -+ int actual_len, -+ int actual_compl_length, -+ int min_len) -+{ -+ int *wca; // Wide character array. -+ char_u *p; -+ int i, c; -+ int has_lower = FALSE; -+ int was_letter = FALSE; -+ -+ IObuff[0] = NUL; -+ -+ // Allocate wide character array for the completion and fill it. -+ wca = ALLOC_MULT(int, actual_len); -+ if (wca == NULL) -+ return IObuff; -+ -+ p = str; -+ for (i = 0; i < actual_len; ++i) -+ if (has_mbyte) -+ wca[i] = mb_ptr2char_adv(&p); -+ else -+ wca[i] = *(p++); -+ -+ // Rule 1: Were any chars converted to lower? -+ p = compl_orig_text; -+ for (i = 0; i < min_len; ++i) -+ { -+ if (has_mbyte) -+ c = mb_ptr2char_adv(&p); -+ else -+ c = *(p++); -+ if (MB_ISLOWER(c)) -+ { -+ has_lower = TRUE; -+ if (MB_ISUPPER(wca[i])) -+ { -+ // Rule 1 is satisfied. -+ for (i = actual_compl_length; i < actual_len; ++i) -+ wca[i] = MB_TOLOWER(wca[i]); -+ break; -+ } -+ } -+ } -+ -+ // Rule 2: No lower case, 2nd consecutive letter converted to -+ // upper case. -+ if (!has_lower) -+ { -+ p = compl_orig_text; -+ for (i = 0; i < min_len; ++i) -+ { -+ if (has_mbyte) -+ c = mb_ptr2char_adv(&p); -+ else -+ c = *(p++); -+ if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i])) -+ { -+ // Rule 2 is satisfied. -+ for (i = actual_compl_length; i < actual_len; ++i) -+ wca[i] = MB_TOUPPER(wca[i]); -+ break; -+ } -+ was_letter = MB_ISLOWER(c) || MB_ISUPPER(c); -+ } -+ } -+ -+ // Copy the original case of the part we typed. -+ p = compl_orig_text; -+ for (i = 0; i < min_len; ++i) -+ { -+ if (has_mbyte) -+ c = mb_ptr2char_adv(&p); -+ else -+ c = *(p++); -+ if (MB_ISLOWER(c)) -+ wca[i] = MB_TOLOWER(wca[i]); -+ else if (MB_ISUPPER(c)) -+ wca[i] = MB_TOUPPER(wca[i]); -+ } -+ -+ // Generate encoding specific output from wide character array. -+ // Multi-byte characters can occupy up to five bytes more than -+ // ASCII characters, and we also need one byte for NUL, so stay -+ // six bytes away from the edge of IObuff. -+ p = IObuff; -+ i = 0; -+ while (i < actual_len && (p - IObuff + 6) < IOSIZE) -+ if (has_mbyte) -+ p += (*mb_char2bytes)(wca[i++], p); -+ else -+ *(p++) = wca[i++]; -+ *p = NUL; -+ -+ vim_free(wca); -+ -+ return IObuff; -+} -+ -+/* - * This is like ins_compl_add(), but if 'ic' and 'inf' are set, then the - * case of the originally typed text is used, and the case of the completed - * text is inferred, ie this tries to work out what case you probably wanted -@@ -423,13 +528,9 @@ ins_compl_add_infercase( - { - char_u *str = str_arg; - char_u *p; -- int i, c; - int actual_len; // Take multi-byte characters - int actual_compl_length; // into account. - int min_len; -- int *wca; // Wide character array. -- int has_lower = FALSE; -- int was_letter = FALSE; - int flags = 0; - - if (p_ic && curbuf->b_p_inf && len > 0) -@@ -469,91 +570,8 @@ ins_compl_add_infercase( - min_len = actual_len < actual_compl_length - ? actual_len : actual_compl_length; - -- // Allocate wide character array for the completion and fill it. -- wca = ALLOC_MULT(int, actual_len); -- if (wca != NULL) -- { -- p = str; -- for (i = 0; i < actual_len; ++i) -- if (has_mbyte) -- wca[i] = mb_ptr2char_adv(&p); -- else -- wca[i] = *(p++); -- -- // Rule 1: Were any chars converted to lower? -- p = compl_orig_text; -- for (i = 0; i < min_len; ++i) -- { -- if (has_mbyte) -- c = mb_ptr2char_adv(&p); -- else -- c = *(p++); -- if (MB_ISLOWER(c)) -- { -- has_lower = TRUE; -- if (MB_ISUPPER(wca[i])) -- { -- // Rule 1 is satisfied. -- for (i = actual_compl_length; i < actual_len; ++i) -- wca[i] = MB_TOLOWER(wca[i]); -- break; -- } -- } -- } -- -- // Rule 2: No lower case, 2nd consecutive letter converted to -- // upper case. -- if (!has_lower) -- { -- p = compl_orig_text; -- for (i = 0; i < min_len; ++i) -- { -- if (has_mbyte) -- c = mb_ptr2char_adv(&p); -- else -- c = *(p++); -- if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i])) -- { -- // Rule 2 is satisfied. -- for (i = actual_compl_length; i < actual_len; ++i) -- wca[i] = MB_TOUPPER(wca[i]); -- break; -- } -- was_letter = MB_ISLOWER(c) || MB_ISUPPER(c); -- } -- } -- -- // Copy the original case of the part we typed. -- p = compl_orig_text; -- for (i = 0; i < min_len; ++i) -- { -- if (has_mbyte) -- c = mb_ptr2char_adv(&p); -- else -- c = *(p++); -- if (MB_ISLOWER(c)) -- wca[i] = MB_TOLOWER(wca[i]); -- else if (MB_ISUPPER(c)) -- wca[i] = MB_TOUPPER(wca[i]); -- } -- -- // Generate encoding specific output from wide character array. -- // Multi-byte characters can occupy up to five bytes more than -- // ASCII characters, and we also need one byte for NUL, so stay -- // six bytes away from the edge of IObuff. -- p = IObuff; -- i = 0; -- while (i < actual_len && (p - IObuff + 6) < IOSIZE) -- if (has_mbyte) -- p += (*mb_char2bytes)(wca[i++], p); -- else -- *(p++) = wca[i++]; -- *p = NUL; -- -- vim_free(wca); -- } -- -- str = IObuff; -+ str = ins_compl_infercase_gettext(str, actual_len, actual_compl_length, -+ min_len); - } - if (cont_s_ipos) - flags |= CP_CONT_S_IPOS; --- -1.8.3.1 - diff --git a/backport-patch-8.2.4867-listing-of-mapping-with-K_SPECIAL-is-.patch b/backport-patch-8.2.4867-listing-of-mapping-with-K_SPECIAL-is-.patch deleted file mode 100644 index 427d53d6cbff7a9ea7c81a6c4ee35cf9b94ab60b..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.4867-listing-of-mapping-with-K_SPECIAL-is-.patch +++ /dev/null @@ -1,112 +0,0 @@ -From ac402f4d64bec6b6efd809fef52f5b34627bf947 Mon Sep 17 00:00:00 2001 -From: zeertzjq -Date: Wed, 4 May 2022 18:51:43 +0100 -Subject: [PATCH] patch 8.2.4867: listing of mapping with K_SPECIAL is wrong - -Problem: Listing of mapping with K_SPECIAL is wrong. -Solution: Adjust escaping of special characters. (closes #10351) ---- - src/map.c | 12 +----------- - src/message.c | 26 ++++++++++++++++++-------- - src/testdir/test_mapping.vim | 20 ++++++++++++++++++++ - 3 files changed, 39 insertions(+), 19 deletions(-) - -diff --git a/src/map.c b/src/map.c -index 645cd10..98573b5 100644 ---- a/src/map.c -+++ b/src/map.c -@@ -186,17 +186,7 @@ showmap( - if (*mp->m_str == NUL) - msg_puts_attr("", HL_ATTR(HLF_8)); - else -- { -- // Remove escaping of CSI, because "m_str" is in a format to be used -- // as typeahead. -- char_u *s = vim_strsave(mp->m_str); -- if (s != NULL) -- { -- vim_unescape_csi(s); -- msg_outtrans_special(s, FALSE, 0); -- vim_free(s); -- } -- } -+ msg_outtrans_special(mp->m_str, FALSE, 0); - #ifdef FEAT_EVAL - if (p_verbose > 0) - last_set_msg(mp->m_script_ctx); -diff --git a/src/message.c b/src/message.c -index eae6e61..0898d90 100644 ---- a/src/message.c -+++ b/src/message.c -@@ -1716,19 +1716,29 @@ str2special( - - if (has_mbyte && !IS_SPECIAL(c)) - { -- int len = (*mb_ptr2len)(str); -+ char_u *p; - -- /* For multi-byte characters check for an illegal byte. */ -- if (has_mbyte && MB_BYTE2LEN(*str) > len) -+ *sp = str; -+ // Try to un-escape a multi-byte character after modifiers. -+ p = mb_unescape(sp); -+ -+ if (p == NULL) - { -- transchar_nonprint(buf, c); -- *sp = str + 1; -- return buf; -+ int len = (*mb_ptr2len)(str); -+ -+ // Check for an illegal byte. -+ if (MB_BYTE2LEN(*str) > len) -+ { -+ transchar_nonprint(curbuf, buf, c); -+ *sp = str + 1; -+ return buf; -+ } -+ *sp = str + len; -+ p = str; - } - /* Since 'special' is TRUE the multi-byte character 'c' will be - * processed by get_special_key_name() */ -- c = (*mb_ptr2char)(str); -- *sp = str + len; -+ c = (*mb_ptr2char)(p); - } - else - *sp = str + 1; -diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim -index 55e6af0..58c284d 100644 ---- a/src/testdir/test_mapping.vim -+++ b/src/testdir/test_mapping.vim -@@ -461,6 +461,26 @@ func Test_list_mappings() - call assert_equal(['i * ShiftSlash'], execute('imap')->trim()->split("\n")) - iunmap - call assert_equal(['No mapping found'], execute('imap')->trim()->split("\n")) -+ -+ nmap foo … -+ call assert_equal(['n foo …'], -+ \ execute('nmap foo')->trim()->split("\n")) -+ -+ " modified character with K_SPECIAL byte in rhs -+ nmap foo -+ call assert_equal(['n foo '], -+ \ execute('nmap foo')->trim()->split("\n")) -+ -+ " character with K_SPECIAL byte in lhs -+ nmap … foo -+ call assert_equal(['n … foo'], -+ \ execute('nmap …')->trim()->split("\n")) -+ -+ " modified character with K_SPECIAL byte in lhs -+ nmap foo -+ call assert_equal(['n foo'], -+ \ execute('nmap ')->trim()->split("\n")) -+ - endfunc - - func Test_expr_map_restore_cursor() --- -1.8.3.1 - diff --git a/backport-patch-8.2.4924-maparg-may-return-a-string-that-canno.patch b/backport-patch-8.2.4924-maparg-may-return-a-string-that-canno.patch deleted file mode 100644 index 1f9523ce4111f55893071a261953ab2524d40e45..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.4924-maparg-may-return-a-string-that-canno.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 0519ce00394474055bd58c089ea90a19986443eb Mon Sep 17 00:00:00 2001 -From: zeertzjq -Date: Mon, 9 May 2022 12:16:19 +0100 -Subject: [PATCH] patch 8.2.4924: maparg() may return a string that cannot be - reused - -Problem: maparg() may return a string that cannot be reused. -Solution: use msg_outtrans_special() instead of str2special(). -(closes #10384) ---- - src/message.c | 35 +++++++++++++++-------------------- - src/option.c | 2 ++ - src/testdir/test_mapping.vim | 7 +++++++ - src/testdir/test_options.vim | 20 ++++++++++++++++++++ - 4 files changed, 44 insertions(+), 20 deletions(-) - -diff --git a/src/message.c b/src/message.c -index 0898d90..363dbe1 100644 ---- a/src/message.c -+++ b/src/message.c -@@ -1637,6 +1637,9 @@ msg_outtrans_special( - } - else - text = (char *)str2special(&str, from); -+ if (text[0] != NUL && text[1] == NUL) -+ // single-byte character or illegal byte -+ text = (char *)transchar_byte((char_u)text[0]); - len = vim_strsize((char_u *)text); - if (maxlen > 0 && retval + len >= maxlen) - break; -@@ -1671,6 +1674,7 @@ str2special_save( - - /* - * Return the printable string for the key codes at "*sp". -+ * On illegal byte return a string with only that byte. - * Used for translating the lhs or rhs of a mapping to printable chars. - * Advances "sp" to the next code. - */ -@@ -1714,7 +1718,7 @@ str2special( - special = TRUE; - } - -- if (has_mbyte && !IS_SPECIAL(c)) -+ if (has_mbyte && !IS_SPECIAL(c) && MB_BYTE2LEN(c) > 1) - { - char_u *p; - -@@ -1722,30 +1726,21 @@ str2special( - // Try to un-escape a multi-byte character after modifiers. - p = mb_unescape(sp); - -- if (p == NULL) -- { -- int len = (*mb_ptr2len)(str); -- -- // Check for an illegal byte. -- if (MB_BYTE2LEN(*str) > len) -- { -- transchar_nonprint(curbuf, buf, c); -- *sp = str + 1; -- return buf; -- } -- *sp = str + len; -- p = str; -- } -- /* Since 'special' is TRUE the multi-byte character 'c' will be -- * processed by get_special_key_name() */ -- c = (*mb_ptr2char)(p); -+ if (p != NULL) -+ // Since 'special' is TRUE the multi-byte character 'c' will be -+ // processed by get_special_key_name() -+ c = (*mb_ptr2char)(p); -+ else -+ // illegal byte -+ *sp = str + 1; - } - else -+ // single-byte character or illegal byte - *sp = str + 1; - -- /* Make unprintable characters in <> form, also and . -+ /* Make special keys and C0 control characters in <> form, also . - * Use only for lhs of a mapping. */ -- if (special || char2cells(c) > 1 || (from && c == ' ')) -+ if (special || c < ' ' || (from && c == ' ')) - return get_special_key_name(c, modifiers); - buf[0] = c; - buf[1] = NUL; -diff --git a/src/option.c b/src/option.c -index eb610dd..6a93a7b 100644 ---- a/src/option.c -+++ b/src/option.c -@@ -3878,6 +3878,8 @@ get_option_value( - if ((char_u **)varp == &curbuf->b_p_key - && **(char_u **)(varp) != NUL) - *stringval = vim_strsave((char_u *)"*****"); -+ else if ((char_u **)varp == &p_pt) // 'pastetoggle' -+ *stringval = str2special_save(*(char_u **)(varp), FALSE); - else - #endif - *stringval = vim_strsave(*(char_u **)(varp)); -diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim -index 58c284d..9e32b38 100644 ---- a/src/testdir/test_mapping.vim -+++ b/src/testdir/test_mapping.vim -@@ -480,6 +480,13 @@ func Test_list_mappings() - nmap foo - call assert_equal(['n foo'], - \ execute('nmap ')->trim()->split("\n")) -+ -+ " illegal bytes -+ let str = ":\x7f:\x80:\x90:\xd0:" -+ exe 'nmap foo ' .. str -+ call assert_equal(['n foo ' .. strtrans(str)], -+ \ execute('nmap foo')->trim()->split("\n")) -+ unlet str - - endfunc - -diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim -index 7584465..e494cd9 100644 ---- a/src/testdir/test_options.vim -+++ b/src/testdir/test_options.vim -@@ -31,6 +31,26 @@ func Test_isfname() - set isfname& - endfunc - -+" Test for getting the value of 'pastetoggle' -+func Test_pastetoggle() -+ " character with K_SPECIAL byte -+ let &pastetoggle = '…' -+ call assert_equal('…', &pastetoggle) -+ call assert_equal("\n pastetoggle=…", execute('set pastetoggle?')) -+ -+ " modified character with K_SPECIAL byte -+ let &pastetoggle = '' -+ call assert_equal('', &pastetoggle) -+ call assert_equal("\n pastetoggle=", execute('set pastetoggle?')) -+ -+ " illegal bytes -+ let str = ":\x7f:\x80:\x90:\xd0:" -+ let &pastetoggle = str -+ call assert_equal(str, &pastetoggle) -+ call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?')) -+ unlet str -+endfunc -+ - func Test_wildchar() - " Empty 'wildchar' used to access invalid memory. - call assert_fails('set wildchar=', 'E521:') --- -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 deleted file mode 100644 index 0340243df5f35a4cf0a48a18975bb6ccc101e55b..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.5007-spell-suggestion-may-use-uninitialize.patch +++ /dev/null @@ -1,95 +0,0 @@ -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/backport-patch-8.2.5149-cannot-build-without-the-eval-feature.patch b/backport-patch-8.2.5149-cannot-build-without-the-eval-feature.patch deleted file mode 100644 index 69ba91ebe94db8e4339010efa2a0e04404223488..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.5149-cannot-build-without-the-eval-feature.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6689df024bce4309ec5884e445738fe07ee4ffcc Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Wed, 22 Jun 2022 18:14:29 +0100 -Subject: [PATCH] patch 8.2.5149: cannot build without the +eval feature - -Problem: Cannot build without the +eval feature. (Tony Mechelynck) -Solution: Add #ifdefs. ---- - src/ex_getln.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/ex_getln.c b/src/ex_getln.c -index 887b47d..8383eee 100644 ---- a/src/ex_getln.c -+++ b/src/ex_getln.c -@@ -820,7 +820,9 @@ getcmdline_int( - cmdline_info_T save_ccline; - int did_save_ccline = FALSE; - int cmdline_type; -+#ifdef FEAT_EVAL - int save_new_cmdpos; -+#endif - - // one recursion level deeper - ++depth; -@@ -1758,7 +1760,9 @@ getcmdline_int( - goto returncmd; // back to cmd mode - - case Ctrl_R: // insert register -+#ifdef FEAT_EVAL - save_new_cmdpos = new_cmdpos; -+#endif - #ifdef USE_ON_FLY_SCROLL - dont_scroll = TRUE; // disallow scrolling here - #endif -@@ -1816,7 +1820,9 @@ getcmdline_int( - } - #endif - } -+#ifdef FEAT_EVAL - new_cmdpos = save_new_cmdpos; -+#endif - - redrawcmd(); - goto cmdline_changed; --- -1.8.3.1 - diff --git a/backport-patch-8.2.5161-might-still-access-invalid-memory.patch b/backport-patch-8.2.5161-might-still-access-invalid-memory.patch deleted file mode 100644 index bd2823d7fa25b16b99fae25eda3eb5e7e76e3576..0000000000000000000000000000000000000000 --- a/backport-patch-8.2.5161-might-still-access-invalid-memory.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0fbc9260a75dfc4d86f20e7c0eb76878f513a212 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 26 Jun 2022 11:17:10 +0100 -Subject: [PATCH] patch 8.2.5161: might still access invalid memory - -Problem: Might still access invalid memory. -Solution: Add extra check for negative value. ---- - src/message.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/message.c b/src/message.c -index 0b690bb..eae6e61 100644 ---- a/src/message.c -+++ b/src/message.c -@@ -876,8 +876,10 @@ msg_may_trunc(int force, char_u *s) - int n; - int room; - -+ // If something unexpected happened "room" may be negative, check for that -+ // just in case. - room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1; -- if ((force || (shortmess(SHM_TRUNC) && !exmode_active)) -+ if (room > 0 && (force || (shortmess(SHM_TRUNC) && !exmode_active)) - && (n = (int)STRLEN(s) - room) > 0) - { - if (has_mbyte) --- -1.8.3.1 - diff --git a/backport-patch-9.0.0022-spell-test-fails.patch b/backport-patch-9.0.0022-spell-test-fails.patch index 00ac68cfaf9571133cc2485a24e7f0557bc9bc23..8670fa9d8b1ae99535020334d585ea9cfb147ee7 100644 --- a/backport-patch-9.0.0022-spell-test-fails.patch +++ b/backport-patch-9.0.0022-spell-test-fails.patch @@ -7,10 +7,10 @@ Problem: Spell test fails. Solution: Expect new error is given. --- src/testdir/test_spell_utf8.vim | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) + 1 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim -index efdecdc..42288dc 100644 +index fe80689..c71308b 100644 --- a/src/testdir/test_spell_utf8.vim +++ b/src/testdir/test_spell_utf8.vim @@ -779,7 +779,12 @@ func Test_no_crash_with_weird_text() diff --git a/backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-conversion.patch b/backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-co.patch similarity index 84% rename from backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-conversion.patch rename to backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-co.patch index 7348500746cab43d4cafaa032d9e195f0e4a8936..f7b0a6eee40b82c6ab80d54a7e5d66c531d487bb 100644 --- a/backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-conversion.patch +++ b/backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-co.patch @@ -7,13 +7,13 @@ Problem: Compiler warning for size_t to int conversion. Solution: Add type cast. (Mike Williams, closes #10741) --- src/insexpand.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + 1 files changed, 1 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c -index 1a64c57..b1114b5 100644 +index 9c598a8..b49a631 100644 --- a/src/insexpand.c +++ b/src/insexpand.c -@@ -527,7 +527,7 @@ ins_compl_infercase_gettext( +@@ -643,7 +643,7 @@ ins_compl_infercase_gettext( if (ga_grow(&gap, IOSIZE) == FAIL) return (char_u *)"[failed]"; STRCPY(gap.ga_data, IObuff); @@ -23,5 +23,5 @@ index 1a64c57..b1114b5 100644 else if (has_mbyte) p += (*mb_char2bytes)(wca[i++], p); -- -2.27.0 +1.8.3.1 diff --git a/backport-semicolon-search-dose-not-work-in-first-line.patch b/backport-semicolon-search-dose-not-work-in-first-line.patch deleted file mode 100644 index 1553db05656599fb792333738a6a58afa6f2b162..0000000000000000000000000000000000000000 --- a/backport-semicolon-search-dose-not-work-in-first-line.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0e71704b77a9891ccae9f5a9c7429e933078f232 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Mon, 27 Apr 2020 19:29:01 +0200 -Subject: [PATCH] patch 8.2.0648: semicolon search does not work in first line - -Problem: Semicolon search does not work in first line. -Solution: Allow the cursor to be in line zero. (Christian Brabandt, - closes #5996) ---- - src/ex_docmd.c | 6 ++++-- - src/testdir/test_cmdline.vim | 11 +++++++++++ - 2 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/src/ex_docmd.c b/src/ex_docmd.c -index 43cd013..ca69c29 100644 ---- a/src/ex_docmd.c -+++ b/src/ex_docmd.c -@@ -3069,8 +3069,10 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent) - if (!eap->skip) - { - curwin->w_cursor.lnum = eap->line2; -- // don't leave the cursor on an illegal line or column -- check_cursor(); -+ // Don't leave the cursor on an illegal line or column, but do -+ // accept zero as address, so 0;/PATTERN/ works correctly. -+ if (eap->line2 > 0) -+ check_cursor(); - } - } - else if (*eap->cmd != ',') -diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim -index 7d3c0c8..a547326 100644 ---- a/src/testdir/test_cmdline.vim -+++ b/src/testdir/test_cmdline.vim -@@ -1471,4 +1471,15 @@ func Test_cmdwin_insert_mode_close() - call assert_equal('yes', caught) - endfunc - -+" test that ";" works to find a match at the start of the first line -+func Test_zero_line_search() -+ new -+ call setline(1, ["1, pattern", "2, ", "3, pattern"]) -+ call cursor(1,1) -+ 0;/pattern/d -+ call assert_equal(["2, ", "3, pattern"], getline(1,'$')) -+ q! -+endfunc -+ -+ - " vim: shiftwidth=2 sts=2 expandtab --- -1.8.3.1 - diff --git a/backport-spell-test-fails-because-error-message-changed.patch b/backport-spell-test-fails-because-error-message-changed.patch new file mode 100644 index 0000000000000000000000000000000000000000..9dd40f1c60dedcedfc03f18feb93324d1a483a91 --- /dev/null +++ b/backport-spell-test-fails-because-error-message-changed.patch @@ -0,0 +1,28 @@ +From 371951d0c34d4f44b50ad8bc8d30a4ef7effade6 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 28 Sep 2022 14:08:23 +0100 +Subject: [PATCH] patch 9.0.0616: spell test fails because error message + changed + +Problem: Spell test fails because error message changed. +Solution: Adjust expected error message. +--- + src/testdir/test_spell.vim | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim +index 9cc7d68..bc948b0 100644 +--- a/src/testdir/test_spell.vim ++++ b/src/testdir/test_spell.vim +@@ -145,7 +145,7 @@ func Test_spell_file_missing() + augroup TestSpellFileMissing + autocmd! SpellFileMissing * bwipe + augroup END +- call assert_fails('set spell spelllang=ab_cd', 'E797:') ++ call assert_fails('set spell spelllang=ab_cd', 'E937:') + + " clean up + augroup TestSpellFileMissing +-- +2.27.0 + diff --git a/backport-spell-test-fails-because-of-new-illegal-byte-check.patch b/backport-spell-test-fails-because-of-new-illegal-byte-check.patch deleted file mode 100644 index 36b2731048c317a9df15561c35d4af6c9fd50d20..0000000000000000000000000000000000000000 --- a/backport-spell-test-fails-because-of-new-illegal-byte-check.patch +++ /dev/null @@ -1,34 +0,0 @@ -From fe978c2b6bb9d897d962595a4a51dd7a71dc8e89 Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 8 May 2022 22:43:51 +0100 -Subject: [PATCH] patch 8.2.4921: spell test fails because of new illegal byte - check - -Problem: Spell test fails because of new illegal byte check. -Solution: Remove the test. ---- - src/testdir/test_spell.vim | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim -index 49118a9..437ad5c 100644 ---- a/src/testdir/test_spell.vim -+++ b/src/testdir/test_spell.vim -@@ -552,14 +552,6 @@ func Test_spell_screendump() - call delete('XtestSpell') - endfunc - --func Test_spell_single_word() -- new -- silent! norm 0R00 -- spell! ß -- silent 0norm 0r$ Dvz= -- bwipe! --endfunc -- - let g:test_data_aff1 = [ - \"SET ISO8859-1", - \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ", --- -1.8.3.1 - diff --git a/backport-test-for-DiffUpdated-fails.patch b/backport-test-for-DiffUpdated-fails.patch deleted file mode 100644 index 93e5bf459b8dee4a0a634287bf0bdda5e5db85a3..0000000000000000000000000000000000000000 --- a/backport-test-for-DiffUpdated-fails.patch +++ /dev/null @@ -1,28 +0,0 @@ -From f65cc665fa751bad3ffe75f58ce1251d6695949f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Sun, 26 Jun 2022 18:17:50 +0100 -Subject: [PATCH] patch 8.2.5166: test for DiffUpdated fails - -Problem: Test for DiffUpdated fails. -Solution: Also accept a count of two. ---- - src/testdir/test_diffmode.vim | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim -index 61edbe2..4ec9556 100644 ---- a/src/testdir/test_diffmode.vim -+++ b/src/testdir/test_diffmode.vim -@@ -33,7 +33,8 @@ func Test_diff_fold_sync() - call win_gotoid(winone) - call assert_equal(23, getcurpos()[1]) - -- call assert_equal(1, g:update_count) -+ " depending on how redraw is done DiffUpdated may be triggered once or twice -+ call assert_inrange(1, 2, g:update_count) - au! DiffUpdated - - windo diffoff --- -2.27.0 - diff --git a/backport-vim-fix-garbled-characters-display-when-file-name-ma.patch b/backport-vim-fix-garbled-characters-display-when-file-name-ma.patch deleted file mode 100644 index 3723e415c79702caeca54c23fd7c744dbee324a8..0000000000000000000000000000000000000000 --- a/backport-vim-fix-garbled-characters-display-when-file-name-ma.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 150fab01a9e9eb61061bf145998b608c5c9c470e Mon Sep 17 00:00:00 2001 -From: lvying6 -Date: Tue, 14 Jul 2020 16:43:33 +0800 -Subject: [PATCH] vim: fix garbled characters display when file name matches - warning or error in tar file - -Reference: https://github.com/vim/vim/issues/6425 - -The problem is, the tar.vim plugin checks if the last line matches -warning or error or a few other keywords and if it does, it aborts. - -Signed-off-by: lvying6 ---- - runtime/autoload/tar.vim | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim -index dc670db..168a2f1 100644 ---- a/runtime/autoload/tar.vim -+++ b/runtime/autoload/tar.vim -@@ -184,7 +184,12 @@ fun! tar#Browse(tarfile) - " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") - return - endif -- if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)') -+ " If there was an error message, the last line probably matches some keywords but -+ " should also contain whitespace for readability. Make sure not to match a -+ " filename that contains the keyword (error/warning/unrecognized/inappropriate, etc) -+ if line("$") == curlast || ( line("$") == (curlast + 1) && -+ \ getline("$") =~# '\c\<\%(warning\|error\|inappropriate\|unrecognized\)\>' && -+ \ getline("$") =~ '\s' ) - redraw! - echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None - keepj sil! %d --- -1.8.3.1 - diff --git a/remove-failed-tests-due-to-patch.patch b/remove-failed-tests-due-to-patch.patch deleted file mode 100644 index fd98da717f947b344fc1fdc0476cd7d04b06b73b..0000000000000000000000000000000000000000 --- a/remove-failed-tests-due-to-patch.patch +++ /dev/null @@ -1,779 +0,0 @@ -From ca7a7ce78d3c12d4c9ed458a7c67866be60aabe8 Mon Sep 17 00:00:00 2001 -From: wangshouping -Date: Sat, 6 Mar 2021 20:55:26 +0800 -Subject: [PATCH] remove test cases of failure due to patch - -reason: Remove test cases of failure due to vim-7.4-syntax.patch/ - vim-8.0-copy-paste.patch/vim-7.4-syncolor.patch. - -Signed-off-by: wangshouping ---- - src/testdir/test_balloon.vim | 47 ---- - src/testdir/test_diffmode.vim | 181 ---------------- - src/testdir/test_filetype.vim | 9 - - src/testdir/test_popupwin.vim | 285 ------------------------- - src/testdir/test_popupwin_textprop.vim | 166 -------------- - 5 files changed, 688 deletions(-) - -diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim -index f32b73c..b7d1a15 100644 ---- a/src/testdir/test_balloon.vim -+++ b/src/testdir/test_balloon.vim -@@ -17,50 +17,3 @@ let s:common_script =<< trim [CODE] - redraw - [CODE] - --func Test_balloon_eval_term() -- " Use after to return from vgetc() without removing -- " the balloon. -- let xtra_lines =<< trim [CODE] -- set updatetime=300 -- au CursorHold * echo 'hold fired' -- func Trigger() -- call test_setmouse(2, 6) -- call feedkeys("\\", "xt") -- endfunc -- [CODE] -- call writefile(s:common_script + xtra_lines, 'XTest_beval') -- -- " Check that the balloon shows up after a mouse move -- let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50}) -- call term_wait(buf, 100) -- call term_sendkeys(buf, 'll') -- call term_sendkeys(buf, ":call Trigger()\") -- call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {}) -- -- " Make sure the balloon still shows after 'updatetime' passed and CursorHold -- " was triggered. -- call term_wait(buf, 300) -- call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XTest_beval') --endfunc -- --func Test_balloon_eval_term_visual() -- " Use after to return from vgetc() without removing -- " the balloon. -- call writefile(s:common_script + [ -- \ 'call test_setmouse(3, 6)', -- \ 'call feedkeys("3Gevfr\\", "xt")', -- \ ], 'XTest_beval_visual') -- -- " Check that the balloon shows up after a mouse move -- let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50}) -- call term_wait(buf, 100) -- call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XTest_beval_visual') --endfunc -diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim -index 9dfe2fe..61edbe2 100644 ---- a/src/testdir/test_diffmode.vim -+++ b/src/testdir/test_diffmode.vim -@@ -748,163 +748,6 @@ func VerifyInternal(buf, dumpfile, extra) - call VerifyScreenDump(a:buf, a:dumpfile, {}) - endfunc - --func Test_diff_screen() -- CheckScreendump -- CheckFeature menu -- -- " clean up already existing swap files, just in case -- call delete('.Xfile1.swp') -- call delete('.Xfile2.swp') -- -- " Test 1: Add a line in beginning of file 2 -- call WriteDiffFiles(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) -- let buf = RunVimInTerminal('-d Xfile1 Xfile2', {}) -- " Set autoread mode, so that Vim won't complain once we re-write the test -- " files -- call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") -- -- call VerifyBoth(buf, 'Test_diff_01', '') -- -- " Test 2: Add a line in beginning of file 1 -- call WriteDiffFiles(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) -- call VerifyBoth(buf, 'Test_diff_02', '') -- -- " Test 3: Add a line at the end of file 2 -- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) -- call VerifyBoth(buf, 'Test_diff_03', '') -- -- " Test 4: Add a line at the end of file 1 -- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) -- call VerifyBoth(buf, 'Test_diff_04', '') -- -- " Test 5: Add a line in the middle of file 2, remove on at the end of file 1 -- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10]) -- call VerifyBoth(buf, 'Test_diff_05', '') -- -- " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 -- call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) -- call VerifyBoth(buf, 'Test_diff_06', '') -- -- " Variants on test 6 with different context settings -- call term_sendkeys(buf, ":set diffopt+=context:2\") -- call VerifyScreenDump(buf, 'Test_diff_06.2', {}) -- call term_sendkeys(buf, ":set diffopt-=context:2\") -- call term_sendkeys(buf, ":set diffopt+=context:1\") -- call VerifyScreenDump(buf, 'Test_diff_06.1', {}) -- call term_sendkeys(buf, ":set diffopt-=context:1\") -- call term_sendkeys(buf, ":set diffopt+=context:0\") -- call VerifyScreenDump(buf, 'Test_diff_06.0', {}) -- call term_sendkeys(buf, ":set diffopt-=context:0\") -- -- " Test 7 - 9: Test normal/patience/histogram diff algorithm -- call WriteDiffFiles(buf, ['#include ', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', -- \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', -- \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', -- \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', -- \ '{', ' frobnitz(fact(10));', '}'], -- \ ['#include ', '', 'int fib(int n)', '{', ' if(n > 2)', ' {', -- \ ' return fib(n-1) + fib(n-2);', ' }', ' return 1;', '}', '', '// Frobs foo heartily', -- \ 'int frobnitz(int foo)', '{', ' int i;', ' for(i = 0; i < 10; i++)', ' {', -- \ ' printf("%d\n", foo);', ' }', '}', '', -- \ 'int main(int argc, char **argv)', '{', ' frobnitz(fib(10));', '}']) -- call term_sendkeys(buf, ":diffupdate!\") -- call term_sendkeys(buf, ":set diffopt+=internal\") -- call VerifyScreenDump(buf, 'Test_diff_07', {}) -- -- call term_sendkeys(buf, ":set diffopt+=algorithm:patience\") -- call VerifyScreenDump(buf, 'Test_diff_08', {}) -- -- call term_sendkeys(buf, ":set diffopt+=algorithm:histogram\") -- call VerifyScreenDump(buf, 'Test_diff_09', {}) -- -- " Test 10-11: normal/indent-heuristic -- call term_sendkeys(buf, ":set diffopt&vim\") -- call WriteDiffFiles(buf, ['', ' def finalize(values)', '', ' values.each do |v|', ' v.finalize', ' end'], -- \ ['', ' def finalize(values)', '', ' values.each do |v|', ' v.prepare', ' end', '', -- \ ' values.each do |v|', ' v.finalize', ' end']) -- call term_sendkeys(buf, ":diffupdate!\") -- call term_sendkeys(buf, ":set diffopt+=internal\") -- call VerifyScreenDump(buf, 'Test_diff_10', {}) -- -- " Leave trailing : at commandline! -- call term_sendkeys(buf, ":set diffopt+=indent-heuristic\:\") -- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'one') -- " shouldn't matter, if indent-algorithm comes before or after the algorithm -- call term_sendkeys(buf, ":set diffopt&\") -- call term_sendkeys(buf, ":set diffopt+=indent-heuristic,algorithm:patience\:\") -- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'two') -- call term_sendkeys(buf, ":set diffopt&\") -- call term_sendkeys(buf, ":set diffopt+=algorithm:patience,indent-heuristic\:\") -- call VerifyScreenDump(buf, 'Test_diff_11', {}, 'three') -- -- " Test 12: diff the same file -- call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) -- call VerifyBoth(buf, 'Test_diff_12', '') -- -- " Test 13: diff an empty file -- call WriteDiffFiles(buf, [], []) -- call VerifyBoth(buf, 'Test_diff_13', '') -- -- " Test 14: test diffopt+=icase -- call WriteDiffFiles(buf, ['a', 'b', 'cd'], ['A', 'b', 'cDe']) -- call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase") -- -- " Test 15-16: test diffopt+=iwhite -- call WriteDiffFiles(buf, ['int main()', '{', ' printf("Hello, World!");', ' return 0;', '}'], -- \ ['int main()', '{', ' if (0)', ' {', ' printf("Hello, World!");', ' return 0;', ' }', '}']) -- call term_sendkeys(buf, ":diffupdate!\") -- call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\") -- call VerifyScreenDump(buf, 'Test_diff_15', {}) -- call term_sendkeys(buf, ":set diffopt+=internal\") -- call VerifyScreenDump(buf, 'Test_diff_16', {}) -- -- " Test 17: test diffopt+=iblank -- call WriteDiffFiles(buf, ['a', ' ', 'cd', 'ef', 'xxx'], ['a', 'cd', '', 'ef', 'yyy']) -- call VerifyInternal(buf, 'Test_diff_17', " diffopt+=iblank") -- -- " Test 18: test diffopt+=iblank,iwhite / iwhiteall / iwhiteeol -- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhite") -- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteall") -- call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteeol") -- -- " Test 19: test diffopt+=iwhiteeol -- call WriteDiffFiles(buf, ['a ', 'x', 'cd', 'ef', 'xx xx', 'foo', 'bar'], ['a', 'x', 'c d', ' ef', 'xx xx', 'foo', '', 'bar']) -- call VerifyInternal(buf, 'Test_diff_19', " diffopt+=iwhiteeol") -- -- " Test 19: test diffopt+=iwhiteall -- call VerifyInternal(buf, 'Test_diff_20', " diffopt+=iwhiteall") -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('Xfile1') -- call delete('Xfile2') --endfunc -- --func Test_diff_with_cursorline() -- CheckScreendump -- -- call writefile([ -- \ 'hi CursorLine ctermbg=red ctermfg=white', -- \ 'set cursorline', -- \ 'call setline(1, ["foo","foo","foo","bar"])', -- \ 'vnew', -- \ 'call setline(1, ["bee","foo","foo","baz"])', -- \ 'windo diffthis', -- \ '2wincmd w', -- \ ], 'Xtest_diff_cursorline') -- let buf = RunVimInTerminal('-S Xtest_diff_cursorline', {}) -- -- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_01', {}) -- call term_sendkeys(buf, "j") -- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_02', {}) -- call term_sendkeys(buf, "j") -- call VerifyScreenDump(buf, 'Test_diff_with_cursorline_03', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('Xtest_diff_cursorline') --endfunc -- - func Test_diff_with_syntax() - CheckScreendump - -@@ -941,30 +784,6 @@ func Test_diff_with_syntax() - call delete('Xprogram2.c') - endfunc - --func Test_diff_of_diff() -- CheckScreendump -- CheckFeature rightleft -- -- call writefile([ -- \ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])', -- \ 'vnew', -- \ 'call setline(1, ["aa","bb","cc"])', -- \ 'windo diffthis', -- \ '1wincmd w', -- \ 'setlocal number', -- \ ], 'Xtest_diff_diff') -- let buf = RunVimInTerminal('-S Xtest_diff_diff', {}) -- -- call VerifyScreenDump(buf, 'Test_diff_of_diff_01', {}) -- -- call term_sendkeys(buf, ":set rightleft\") -- call VerifyScreenDump(buf, 'Test_diff_of_diff_02', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('Xtest_diff_diff') --endfunc -- - func CloseoffSetup() - enew - call setline(1, ['one', 'two', 'three']) -diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim -index 31357e7..15cd11a 100644 ---- a/src/testdir/test_filetype.vim -+++ b/src/testdir/test_filetype.vim -@@ -538,15 +538,6 @@ func CheckItems(checks) - endfor - endfunc - --func Test_filetype_detection() -- filetype on -- call CheckItems(s:filename_checks) -- if has('fname_case') -- call CheckItems(s:filename_case_checks) -- endif -- filetype off --endfunc -- - " Filetypes detected from the file contents by scripts.vim - let s:script_checks = { - \ 'virata': [['% Virata'], -diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim -index d5ee716..43e6028 100644 ---- a/src/testdir/test_popupwin.vim -+++ b/src/testdir/test_popupwin.vim -@@ -519,122 +519,6 @@ func Test_popup_noscrolloff() - call popup_close(winid) - endfunc - --func Test_popup_drag() -- CheckScreendump -- -- " create a popup that covers the command line -- let lines =<< trim END -- call setline(1, range(1, 20)) -- split -- vsplit -- $wincmd w -- vsplit -- 1wincmd w -- let winid = popup_create(['1111', '222222', '33333'], #{ -- \ drag: 1, -- \ resize: 1, -- \ border: [], -- \ line: &lines - 4, -- \ }) -- func Dragit() -- call feedkeys("\\\\\", "xt") -- endfunc -- map :call test_setmouse(&lines - 4, &columns / 2) -- map :call test_setmouse(&lines - 8, &columns / 2 - 20) -- func Resize() -- call feedkeys("\\\\\", "xt") -- endfunc -- map :call test_setmouse(6, 21) -- map :call test_setmouse(7, 25) -- END -- call writefile(lines, 'XtestPopupDrag') -- let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10}) -- call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) -- -- call term_sendkeys(buf, ":call Dragit()\") -- call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {}) -- -- call term_sendkeys(buf, ":call Resize()\") -- call VerifyScreenDump(buf, 'Test_popupwin_drag_03', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestPopupDrag') --endfunc -- --func Test_popup_close_with_mouse() -- CheckScreendump -- -- let lines =<< trim END -- call setline(1, range(1, 20)) -- " With border, can click on X -- let winid = popup_create('foobar', #{ -- \ close: 'button', -- \ border: [], -- \ line: 1, -- \ col: 1, -- \ }) -- func CloseMsg(id, result) -- echomsg 'Popup closed with ' .. a:result -- endfunc -- let winid = popup_create('notification', #{ -- \ close: 'click', -- \ line: 3, -- \ col: 15, -- \ callback: 'CloseMsg', -- \ }) -- let winid = popup_create('no border here', #{ -- \ close: 'button', -- \ line: 5, -- \ col: 3, -- \ }) -- let winid = popup_create('only padding', #{ -- \ close: 'button', -- \ padding: [], -- \ line: 5, -- \ col: 23, -- \ }) -- func CloseWithX() -- call feedkeys("\\\", "xt") -- endfunc -- map :call test_setmouse(1, len('foobar') + 2) -- func CloseWithClick() -- call feedkeys("\\\", "xt") -- endfunc -- map :call test_setmouse(3, 17) -- func CreateWithMenuFilter() -- let winid = popup_create('barfoo', #{ -- \ close: 'button', -- \ filter: 'popup_filter_menu', -- \ border: [], -- \ line: 1, -- \ col: 40, -- \ }) -- endfunc -- END -- call writefile(lines, 'XtestPopupClose') -- let buf = RunVimInTerminal('-S XtestPopupClose', #{rows: 10}) -- call VerifyScreenDump(buf, 'Test_popupwin_close_01', {}) -- -- call term_sendkeys(buf, ":call CloseWithX()\") -- call VerifyScreenDump(buf, 'Test_popupwin_close_02', {}) -- -- call term_sendkeys(buf, ":call CloseWithClick()\") -- call VerifyScreenDump(buf, 'Test_popupwin_close_03', {}) -- -- call term_sendkeys(buf, ":call CreateWithMenuFilter()\") -- call VerifyScreenDump(buf, 'Test_popupwin_close_04', {}) -- -- " We have to send the actual mouse code, feedkeys() would be caught the -- " filter. -- call term_sendkeys(buf, "\[<0;47;1M") -- call VerifyScreenDump(buf, 'Test_popupwin_close_05', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestPopupClose') --endfunction -- - func Test_popup_menu_wrap() - CheckScreendump - -@@ -1335,52 +1219,6 @@ func Test_popup_atcursor_pos() - call delete('XtestPopupAtcursorPos') - endfunc - --func Test_popup_beval() -- CheckScreendump -- CheckFeature balloon_eval_term -- -- let lines =<< trim END -- call setline(1, range(1, 20)) -- call setline(5, 'here is some text to hover over') -- set balloonevalterm -- set balloonexpr=BalloonExpr() -- set balloondelay=100 -- func BalloonExpr() -- let s:winid = [v:beval_text]->popup_beval({}) -- return '' -- endfunc -- func Hover() -- call test_setmouse(5, 15) -- call feedkeys("\\", "xt") -- sleep 100m -- endfunc -- func MoveOntoPopup() -- call test_setmouse(4, 17) -- call feedkeys("\\\", "xt") -- endfunc -- func MoveAway() -- call test_setmouse(5, 13) -- call feedkeys("\\\", "xt") -- endfunc -- END -- call writefile(lines, 'XtestPopupBeval') -- let buf = RunVimInTerminal('-S XtestPopupBeval', #{rows: 10}) -- call term_wait(buf, 100) -- call term_sendkeys(buf, 'j') -- call term_sendkeys(buf, ":call Hover()\") -- call VerifyScreenDump(buf, 'Test_popupwin_beval_1', {}) -- -- call term_sendkeys(buf, ":call MoveOntoPopup()\") -- call VerifyScreenDump(buf, 'Test_popupwin_beval_2', {}) -- -- call term_sendkeys(buf, ":call MoveAway()\") -- call VerifyScreenDump(buf, 'Test_popupwin_beval_3', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestPopupBeval') --endfunc -- - func Test_popup_filter() - new - call setline(1, 'some text') -@@ -1895,129 +1733,6 @@ func Test_notifications() - call delete('XtestNotifications') - endfunc - --func Test_popup_scrollbar() -- CheckScreendump -- -- let lines =<< trim END -- call setline(1, range(1, 20)) -- hi ScrollThumb ctermbg=blue -- hi ScrollBar ctermbg=red -- let winid = popup_create(['one', 'two', 'three', 'four', 'five', -- \ 'six', 'seven', 'eight', 'nine'], #{ -- \ minwidth: 8, -- \ maxheight: 4, -- \ }) -- func ScrollUp() -- call feedkeys("\\", "xt") -- endfunc -- func ScrollDown() -- call feedkeys("\\", "xt") -- endfunc -- func ClickTop() -- call feedkeys("\\", "xt") -- endfunc -- func ClickBot() -- call popup_setoptions(g:winid, #{border: [], close: 'button'}) -- call feedkeys("\\", "xt") -- endfunc -- func Popup_filter(winid, key) -- if a:key == 'j' -- let line = popup_getoptions(a:winid).firstline -- let nlines = line('$', a:winid) -- let newline = line < nlines ? (line + 1) : nlines -- call popup_setoptions(a:winid, #{firstline: newline}) -- return v:true -- elseif a:key == 'x' -- call popup_close(a:winid) -- return v:true -- endif -- endfunc -- -- func PopupScroll() -- call popup_clear() -- let text =<< trim END -- 1 -- 2 -- 3 -- 4 -- long line long line long line long line long line long line -- long line long line long line long line long line long line -- long line long line long line long line long line long line -- END -- call popup_create(text, #{ -- \ minwidth: 30, -- \ maxwidth: 30, -- \ minheight: 4, -- \ maxheight: 4, -- \ firstline: 1, -- \ lastline: 4, -- \ wrap: v:true, -- \ scrollbar: v:true, -- \ mapping: v:false, -- \ filter: funcref('Popup_filter') -- \ }) -- endfunc -- map :call test_setmouse(5, 36) -- map :call test_setmouse(4, 42) -- map :call test_setmouse(7, 42) -- END -- call writefile(lines, 'XtestPopupScroll') -- let buf = RunVimInTerminal('-S XtestPopupScroll', #{rows: 10}) -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_1', {}) -- -- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 2})\") -- call term_sendkeys(buf, ":\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_2', {}) -- -- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 6})\") -- call term_sendkeys(buf, ":\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_3', {}) -- -- call term_sendkeys(buf, ":call popup_setoptions(winid, #{firstline: 9})\") -- call term_sendkeys(buf, ":\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {}) -- -- call term_sendkeys(buf, ":call popup_setoptions(winid, #{scrollbarhighlight: 'ScrollBar', thumbhighlight: 'ScrollThumb', firstline: 5})\") -- " this scrolls two lines (half the window height) -- call term_sendkeys(buf, ":call ScrollUp()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_5', {}) -- -- call term_sendkeys(buf, ":call ScrollDown()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_6', {}) -- -- call term_sendkeys(buf, ":call ScrollDown()\") -- " wait a bit, otherwise it fails sometimes (double click recognized?) -- sleep 100m -- call term_sendkeys(buf, ":call ScrollDown()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_7', {}) -- -- call term_sendkeys(buf, ":call ClickTop()\") -- sleep 100m -- call term_sendkeys(buf, ":call ClickTop()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_8', {}) -- -- call term_sendkeys(buf, ":call ClickBot()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_9', {}) -- -- " remove the minwidth and maxheight -- call term_sendkeys(buf, ":call popup_setoptions(winid, #{maxheight: 0, minwidth: 0})\") -- call term_sendkeys(buf, ":\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_10', {}) -- -- " check size with non-wrapping lines -- call term_sendkeys(buf, ":call PopupScroll()\") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_11', {}) -- -- " check size with wrapping lines -- call term_sendkeys(buf, "j") -- call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {}) -- call term_sendkeys(buf, "x") -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestPopupScroll') --endfunc -- - func Test_popup_fitting_scrollbar() - " this was causing a crash, divide by zero - let winid = popup_create([ -diff --git a/src/testdir/test_popupwin_textprop.vim b/src/testdir/test_popupwin_textprop.vim -index 1b339d4..a42129d 100644 ---- a/src/testdir/test_popupwin_textprop.vim -+++ b/src/testdir/test_popupwin_textprop.vim -@@ -7,170 +7,4 @@ CheckFeature textprop - source screendump.vim - CheckScreendump - --func Test_textprop_popup() -- let lines =<< trim END -- call setline(1, range(1, 100)) -- call setline(50, 'some text to work with') -- 50 -- normal zz -- set scrolloff=0 -- call prop_type_add('popupMarker', #{highlight: 'DiffAdd', bufnr: bufnr('%')}) -- call prop_add(50, 11, #{ -- \ length: 7, -- \ type: 'popupMarker', -- \ bufnr: bufnr('%'), -- \ }) -- let winid = popup_create('the text', #{ -- \ pos: 'botleft', -- \ textprop: 'popupMarker', -- \ border: [], -- \ padding: [0,1,0,1], -- \ close: 'click', -- \ }) -- END -- call writefile(lines, 'XtestTextpropPopup') -- let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10}) -- call VerifyScreenDump(buf, 'Test_popup_textprop_01', {}) -- -- call term_sendkeys(buf, "zt") -- call VerifyScreenDump(buf, 'Test_popup_textprop_02', {}) -- -- call term_sendkeys(buf, "zzIawe\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_03', {}) -- -- call term_sendkeys(buf, "0dw") -- call VerifyScreenDump(buf, 'Test_popup_textprop_04', {}) -- -- call term_sendkeys(buf, "Oinserted\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_05', {}) -- -- call term_sendkeys(buf, "k2dd") -- call VerifyScreenDump(buf, 'Test_popup_textprop_06', {}) -- -- call term_sendkeys(buf, "4\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_07', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestTextpropPopup') --endfunc -- --func Test_textprop_popup_corners() -- let lines =<< trim END -- call setline(1, range(1, 100)) -- call setline(50, 'now working with some longer text here') -- 50 -- normal zz -- set scrolloff=0 -- call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) -- call prop_add(50, 23, #{ -- \ length: 6, -- \ type: 'popupMarker', -- \ }) -- let winid = popup_create('bottom left', #{ -- \ pos: 'botleft', -- \ textprop: 'popupMarker', -- \ textpropwin: win_getid(), -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('bottom right', #{ -- \ pos: 'botright', -- \ textprop: 'popupMarker', -- \ border: [], -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('top left', #{ -- \ pos: 'topleft', -- \ textprop: 'popupMarker', -- \ border: [], -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('top right', #{ -- \ pos: 'topright', -- \ textprop: 'popupMarker', -- \ padding: [0,1,0,1], -- \ }) -- END -- call writefile(lines, 'XtestTextpropPopupCorners') -- let buf = RunVimInTerminal('-S XtestTextpropPopupCorners', #{rows: 12}) -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_1', {}) -- -- call term_sendkeys(buf, "0dw") -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_2', {}) -- -- call term_sendkeys(buf, "46Goextra\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_3', {}) -- -- call term_sendkeys(buf, "u") -- call term_sendkeys(buf, ":\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_4', {}) -- -- call term_sendkeys(buf, ":vsplit foo\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_5', {}) -- -- call term_sendkeys(buf, ":only!\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_corn_6', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestTextpropPopupCorners') --endfunc -- --func Test_textprop_popup_offsets() -- let lines =<< trim END -- call setline(1, range(1, 100)) -- call setline(50, 'now working with some longer text here') -- 50 -- normal zz -- set scrolloff=0 -- call prop_type_add('popupMarker', #{highlight: 'DiffAdd'}) -- call prop_add(50, 23, #{ -- \ length: 6, -- \ type: 'popupMarker', -- \ }) -- let winid = popup_create('bottom left', #{ -- \ pos: 'botleft', -- \ line: -1, -- \ col: 2, -- \ textprop: 'popupMarker', -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('bottom right', #{ -- \ pos: 'botright', -- \ line: -1, -- \ col: -2, -- \ textprop: 'popupMarker', -- \ border: [], -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('top left', #{ -- \ pos: 'topleft', -- \ line: 1, -- \ col: 2, -- \ textprop: 'popupMarker', -- \ border: [], -- \ padding: [0,1,0,1], -- \ }) -- let winid = popup_create('top right', #{ -- \ pos: 'topright', -- \ line: 1, -- \ col: -2, -- \ textprop: 'popupMarker', -- \ padding: [0,1,0,1], -- \ }) -- END -- call writefile(lines, 'XtestTextpropPopupOffset') -- let buf = RunVimInTerminal('-S XtestTextpropPopupOffset', #{rows: 12}) -- call VerifyScreenDump(buf, 'Test_popup_textprop_off_1', {}) -- -- " test that removing the text property closes the popups -- call term_sendkeys(buf, ":call prop_clear(50)\") -- call VerifyScreenDump(buf, 'Test_popup_textprop_off_2', {}) -- -- " clean up -- call StopVimInTerminal(buf) -- call delete('XtestTextpropPopupOffset') --endfunc -- -- - " vim: shiftwidth=2 sts=2 --- -2.19.1 - diff --git a/vim-1667352810.73f01bf.tar b/vim-1667352810.73f01bf.tar new file mode 100644 index 0000000000000000000000000000000000000000..529d21b7df9beb406809b554c1a015b43640e110 Binary files /dev/null and b/vim-1667352810.73f01bf.tar differ diff --git a/vim-7.0-fixkeys.patch b/vim-7.0-fixkeys.patch index 4092b3e63c15ab798f9bf13d4942350685b5a8e8..c7476338ed514221ce31a6ac0a14a85ddd487d03 100644 --- a/vim-7.0-fixkeys.patch +++ b/vim-7.0-fixkeys.patch @@ -1,26 +1,26 @@ -diff -up vim81/src/term.c.fixkeys vim81/src/term.c ---- vim81/src/term.c.fixkeys 2019-12-12 09:00:20.685567074 +0100 -+++ vim81/src/term.c 2019-12-12 09:21:36.708769626 +0100 -@@ -957,14 +957,14 @@ static struct builtin_term builtin_termc - {K_XRIGHT, IF_EB("\033[1;*C", ESC_STR "[1;*C")}, - {K_XLEFT, IF_EB("\033[1;*D", ESC_STR "[1;*D")}, +diff -up vim82/src/term.c.fixkeys vim82/src/term.c +--- vim82/src/term.c.fixkeys 2022-02-07 09:23:09.195365881 +0100 ++++ vim82/src/term.c 2022-02-07 09:31:31.279695977 +0100 +@@ -921,14 +921,14 @@ static struct builtin_term builtin_termc + {K_XRIGHT, "\033[@;*C"}, + {K_XLEFT, "\033[@;*D"}, // An extra set of function keys for vt100 mode -- {K_XF1, IF_EB("\033O*P", ESC_STR "O*P")}, -- {K_XF2, IF_EB("\033O*Q", ESC_STR "O*Q")}, -- {K_XF3, IF_EB("\033O*R", ESC_STR "O*R")}, -- {K_XF4, IF_EB("\033O*S", ESC_STR "O*S")}, -- {K_F1, IF_EB("\033[11;*~", ESC_STR "[11;*~")}, -- {K_F2, IF_EB("\033[12;*~", ESC_STR "[12;*~")}, -- {K_F3, IF_EB("\033[13;*~", ESC_STR "[13;*~")}, -- {K_F4, IF_EB("\033[14;*~", ESC_STR "[14;*~")}, -+ {K_XF1, IF_EB("\033[11~", ESC_STR "[11~")}, -+ {K_XF2, IF_EB("\033[12~", ESC_STR "[12~")}, -+ {K_XF3, IF_EB("\033[13~", ESC_STR "[13~")}, -+ {K_XF4, IF_EB("\033[14~", ESC_STR "[14~")}, -+ {K_F1, IF_EB("\033OP", ESC_STR "OP")}, -+ {K_F2, IF_EB("\033OQ", ESC_STR "OQ")}, -+ {K_F3, IF_EB("\033OR", ESC_STR "OR")}, -+ {K_F4, IF_EB("\033OS", ESC_STR "OS")}, - {K_F5, IF_EB("\033[15;*~", ESC_STR "[15;*~")}, - {K_F6, IF_EB("\033[17;*~", ESC_STR "[17;*~")}, - {K_F7, IF_EB("\033[18;*~", ESC_STR "[18;*~")}, +- {K_XF1, "\033O*P"}, +- {K_XF2, "\033O*Q"}, +- {K_XF3, "\033O*R"}, +- {K_XF4, "\033O*S"}, +- {K_F1, "\033[11;*~"}, +- {K_F2, "\033[12;*~"}, +- {K_F3, "\033[13;*~"}, +- {K_F4, "\033[14;*~"}, ++ {K_XF1, "\033[11~"}, ++ {K_XF2, "\033[12~"}, ++ {K_XF3, "\033[13~"}, ++ {K_XF4, "\033[14~"}, ++ {K_F1, "\033OP"}, ++ {K_F2, "\033OQ"}, ++ {K_F3, "\033OR"}, ++ {K_F4, "\033OS"}, + {K_F5, "\033[15;*~"}, + {K_F6, "\033[17;*~"}, + {K_F7, "\033[18;*~"}, diff --git a/vim-7.0-rclocation.patch b/vim-7.0-rclocation.patch deleted file mode 100644 index 840f53e8cc330d89947618569d2a16ec2ab5305a..0000000000000000000000000000000000000000 --- a/vim-7.0-rclocation.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- vim62/src/os_unix.h.rcloc 2003-08-04 15:38:05.000000000 +0200 -+++ vim62/src/os_unix.h 2003-08-04 15:39:25.000000000 +0200 -@@ -230,10 +230,10 @@ - * Unix system-dependent file names - */ - #ifndef SYS_VIMRC_FILE --# define SYS_VIMRC_FILE "$VIM/vimrc" -+# define SYS_VIMRC_FILE "/etc/vimrc" - #endif - #ifndef SYS_GVIMRC_FILE --# define SYS_GVIMRC_FILE "$VIM/gvimrc" -+# define SYS_GVIMRC_FILE "/etc/gvimrc" - #endif - #ifndef DFLT_HELPFILE - # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" diff --git a/vim-7.4-checkhl.patch b/vim-7.4-checkhl.patch deleted file mode 100644 index f7fbf90418a27761f6ea65d230fae6248d349e83..0000000000000000000000000000000000000000 --- a/vim-7.4-checkhl.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up vim74/runtime/syntax/spec.vim.kh1 vim74/runtime/syntax/spec.vim ---- vim74/runtime/syntax/spec.vim.kh1 2016-08-04 15:23:25.275955301 +0200 -+++ vim74/runtime/syntax/spec.vim 2016-08-04 15:24:56.699417602 +0200 -@@ -114,7 +114,7 @@ syn region specDescriptionArea matchgrou - syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment - - "%% Scripts Section %% --syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 -+syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|check\|clean\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 - - "%% Changelog Section %% - syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense diff --git a/vim-7.4-fstabsyntax.patch b/vim-7.4-fstabsyntax.patch index 87ddef43a943ff2ad42fb8252a24df2312e73b6d..81d39da9d7c5eca0a5f49add004464dfcc5ea8af 100644 --- a/vim-7.4-fstabsyntax.patch +++ b/vim-7.4-fstabsyntax.patch @@ -1,6 +1,6 @@ -diff -up vim81/runtime/syntax/fstab.vim.fstabsyntax vim81/runtime/syntax/fstab.vim ---- vim81/runtime/syntax/fstab.vim.fstabsyntax 2019-06-11 09:55:23.000000000 +0200 -+++ vim81/runtime/syntax/fstab.vim 2019-06-11 10:14:22.223616868 +0200 +diff -up vim82/runtime/syntax/fstab.vim.fstabsyntax vim82/runtime/syntax/fstab.vim +--- vim82/runtime/syntax/fstab.vim.fstabsyntax 2020-08-10 12:08:01.000000000 +0200 ++++ vim82/runtime/syntax/fstab.vim 2020-08-10 12:17:22.540855735 +0200 @@ -56,7 +56,7 @@ syn keyword fsMountPointKeyword containe " Type syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown @@ -14,7 +14,7 @@ diff -up vim81/runtime/syntax/fstab.vim.fstabsyntax vim81/runtime/syntax/fstab.v syn keyword fsOptionsYesNo yes no syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck syn keyword fsOptionsSize 512 1024 2048 --syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail +-syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok +syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop managed mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner pamconsole rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail syn match fsOptionsGeneral /_netdev/ diff --git a/vim-7.4-globalsyntax.patch b/vim-7.4-globalsyntax.patch index 1e0b08ed9a4b024841811343ee83f1e8bcfb9cb7..4503f2d06d7a4780011216cd781f8da25b737b19 100644 --- a/vim-7.4-globalsyntax.patch +++ b/vim-7.4-globalsyntax.patch @@ -1,12 +1,13 @@ -diff -up vim74/runtime/syntax/spec.vim.orig vim74/runtime/syntax/spec.vim ---- vim74/runtime/syntax/spec.vim.orig 2016-01-12 13:51:55.727569873 +0100 -+++ vim74/runtime/syntax/spec.vim 2016-01-12 13:53:08.124991178 +0100 -@@ -114,7 +114,7 @@ syn region specDescriptionArea matchgrou +diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim +index 1a5a108..b709d20 100644 +--- a/runtime/syntax/spec.vim ++++ b/runtime/syntax/spec.vim +@@ -111,7 +111,7 @@ syn region specDescriptionArea matchgroup=specSection start='^%description' end= syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment "%% Scripts Section %% --syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|check\|clean\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 -+syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|check\|clean\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|global\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 +-syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 ++syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|global\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 "%% Changelog Section %% syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense diff --git a/vim-7.4-nowarnings.patch b/vim-7.4-nowarnings.patch deleted file mode 100644 index a98e9d61aeb45495221c5c4e15b026aba5a2414f..0000000000000000000000000000000000000000 --- a/vim-7.4-nowarnings.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up vim81/src/ex_docmd.c.backup vim81/src/ex_docmd.c ---- vim81/src/ex_docmd.c.backup 2019-01-22 17:35:28.701320672 +0100 -+++ vim81/src/ex_docmd.c 2019-01-22 17:36:56.644540351 +0100 -@@ -4793,6 +4793,7 @@ get_flags(exarg_T *eap) - void - ex_ni(exarg_T *eap) - { -+ return; - if (!eap->skip) - eap->errmsg = N_("E319: Sorry, the command is not available in this version"); - } diff --git a/vim-7.4-releasestring-1318991.patch b/vim-7.4-releasestring-1318991.patch deleted file mode 100644 index 291b957fbba3a8ec06d408377f8ce592817817d1..0000000000000000000000000000000000000000 --- a/vim-7.4-releasestring-1318991.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up vim74/runtime/ftplugin/spec.vim.1318991 vim74/runtime/ftplugin/spec.vim ---- vim74/runtime/ftplugin/spec.vim.1318991 2016-08-04 15:29:42.423862424 +0200 -+++ vim74/runtime/ftplugin/spec.vim 2016-08-04 15:31:08.797299188 +0200 -@@ -41,8 +41,8 @@ else: - headers = spec.sourceHeader - version = headers["Version"] - release = headers["Release"] -- vim.command("let ver = " + version) -- vim.command("let rel = " + release) -+ vim.command("let ver = '" + version + "'") -+ vim.command("let rel = '" + release + "'") - PYEND - endif - endfunction diff --git a/vim-7.4-syncolor.patch b/vim-7.4-syncolor.patch deleted file mode 100644 index b41f2fe3bf6bfd3a63c90860b276d8d8cbebadbb..0000000000000000000000000000000000000000 --- a/vim-7.4-syncolor.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/highlight.c b/src/highlight.c -index 9322f96..f7147a0 100644 ---- a/src/highlight.c -+++ b/src/highlight.c -@@ -211,8 +211,8 @@ static char *(highlight_init_light[]) = { - CENT("Visual term=reverse", - "Visual term=reverse guibg=LightGrey"), - #ifdef FEAT_DIFF -- CENT("DiffAdd term=bold ctermbg=LightBlue", -- "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue"), -+ CENT("DiffAdd term=bold ctermbg=LightRed", -+ "DiffAdd term=bold ctermbg=LightRed guibg=LightBlue"), - CENT("DiffChange term=bold ctermbg=LightMagenta", - "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta"), - CENT("DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan", -@@ -304,8 +304,8 @@ static char *(highlight_init_dark[]) = { - CENT("Visual term=reverse", - "Visual term=reverse guibg=DarkGrey"), - #ifdef FEAT_DIFF -- CENT("DiffAdd term=bold ctermbg=DarkBlue", -- "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue"), -+ CENT("DiffAdd term=bold ctermbg=DarkRed", -+ "DiffAdd term=bold ctermbg=DarkRed guibg=DarkBlue"), - CENT("DiffChange term=bold ctermbg=DarkMagenta", - "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta"), - CENT("DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan", diff --git a/vim-7.4-syntax.patch b/vim-7.4-syntax.patch deleted file mode 100644 index 5131c80318f371e39642952db05bb067c00f8730..0000000000000000000000000000000000000000 --- a/vim-7.4-syntax.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- vim74/runtime/filetype.vim.orig 2013-08-12 14:51:58.669350813 +0200 -+++ vim74/runtime/filetype.vim 2013-08-12 14:56:12.432540523 +0200 -@@ -2475,7 +2475,7 @@ - - " More Apache config files - au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache') --au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') -+au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/httpd/conf.*/*,*/etc/httpd/mods-*/*,*/etc/httpd/sites-*/*,*/etc/httpd/conf.d/*.conf*,auth_mysql.conf*,auth_pgsql.conf*,ssl.conf*,perl.conf*,php.conf*,python.conf*,squirrelmail.conf* call s:StarSetf('apache') - - " Asterisk config file - au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') diff --git a/vim-8.0-copy-paste.patch b/vim-8.0-copy-paste.patch index 1ef4c9b154dec44af75606739602fcb0ece39481..bd5bbd44330798263a7bf40ccdf1ce2330a0f220 100644 --- a/vim-8.0-copy-paste.patch +++ b/vim-8.0-copy-paste.patch @@ -1,7 +1,8 @@ -diff -up vim81/runtime/defaults.vim.copypaste vim81/runtime/defaults.vim ---- vim81/runtime/defaults.vim.copypaste 2019-10-30 10:30:23.108710252 +0100 -+++ vim81/runtime/defaults.vim 2019-10-30 10:36:19.127508406 +0100 -@@ -73,18 +73,6 @@ map Q gq +diff --git a/runtime/defaults.vim b/runtime/defaults.vim +index f1d5cd1..b08de8e 100644 +--- a/runtime/defaults.vim ++++ b/runtime/defaults.vim +@@ -74,18 +74,6 @@ sunmap Q " Revert with ":iunmap ". inoremap u @@ -17,6 +18,70 @@ diff -up vim81/runtime/defaults.vim.copypaste vim81/runtime/defaults.vim - endif -endif - - " Switch syntax highlighting on when the terminal has colors or when using the - " GUI (which always has colors). - if &t_Co > 2 || has("gui_running") + " Only do this part when Vim was compiled with the +eval feature. + if 1 + +diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim +index ed0c6c1..90c8c40 100644 +--- a/src/testdir/test_balloon.vim ++++ b/src/testdir/test_balloon.vim +@@ -9,6 +9,7 @@ source screendump.vim + CheckScreendump + + let s:common_script =<< trim [CODE] ++ set mouse=a + call setline(1, ["one one one", "two tXo two", "three three three"]) + set balloonevalterm balloonexpr=MyBalloonExpr()..s:trailing balloondelay=100 + let s:trailing = '<' " check that script context is set +diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim +index b91689e..c6b70d1 100644 +--- a/src/testdir/test_popupwin.vim ++++ b/src/testdir/test_popupwin.vim +@@ -553,6 +553,7 @@ func Test_popup_drag() + " create a popup that covers the command line + let lines =<< trim END + call setline(1, range(1, 20)) ++ set mouse=a + split + vsplit + $wincmd w +@@ -621,6 +622,7 @@ func Test_popup_drag_minwidth() + + " create a popup that does not fit + let lines =<< trim END ++ set mouse=a + call range(40) + \ ->map({_,i -> string(i)}) + \ ->popup_create({ +@@ -669,6 +671,7 @@ func Test_popup_drag_termwin() + let lines =<< trim END + set foldmethod=marker + call setline(1, range(100)) ++ set mouse=a + for nr in range(7) + call setline(nr * 12 + 1, "fold {{{") + call setline(nr * 12 + 11, "end }}}") +@@ -722,6 +725,7 @@ func Test_popup_close_with_mouse() + + let lines =<< trim END + call setline(1, range(1, 20)) ++ set mouse=a + " With border, can click on X + let winid = popup_create('foobar', #{ + \ close: 'button', +@@ -1557,6 +1561,7 @@ func Test_popup_beval() + let lines =<< trim END + call setline(1, range(1, 20)) + call setline(5, 'here is some text to hover over') ++ set mouse=a + set balloonevalterm + set balloonexpr=BalloonExpr() + set balloondelay=100 +@@ -2262,6 +2267,7 @@ func Test_popup_scrollbar() + + let lines =<< trim END + call setline(1, range(1, 20)) ++ set mouse=a + hi ScrollThumb ctermbg=blue + hi ScrollBar ctermbg=red + let winid = popup_create(['one', 'two', 'three', 'four', 'five', diff --git a/vim-8.2.tar.bz2 b/vim-9.0.tar.bz2 similarity index 56% rename from vim-8.2.tar.bz2 rename to vim-9.0.tar.bz2 index ceeb7c26e5f950f5018d6d732ddc1d186c0cbcbf..63d323c87f3ebe14c2674f670bed27d4ee31f747 100644 Binary files a/vim-8.2.tar.bz2 and b/vim-9.0.tar.bz2 differ diff --git a/vim-python3-tests.patch b/vim-python3-tests.patch index 26027f748db5e88eaa31280cedc4ea92baf5d328..98b5f7587c8d0da037180b4bf41b8d032de7ee78 100644 --- a/vim-python3-tests.patch +++ b/vim-python3-tests.patch @@ -1,16 +1,16 @@ -diff -up vim80/runtime/tools/demoserver.py.python3-tests vim80/runtime/tools/demoserver.py ---- vim80/runtime/tools/demoserver.py.python3-tests 2018-05-11 08:24:41.774618804 +0200 -+++ vim80/runtime/tools/demoserver.py 2018-05-11 09:24:48.363309856 +0200 +diff -up vim82/runtime/tools/demoserver.py.python-tests vim82/runtime/tools/demoserver.py +--- vim82/runtime/tools/demoserver.py.python-tests 2019-07-26 07:58:50.000000000 +0200 ++++ vim82/runtime/tools/demoserver.py 2020-04-17 06:18:06.748977527 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Server that will accept connections from a Vim channel. # Run this server and then in Vim you can open the channel: -diff -up vim80/src/auto/configure.python3-tests vim80/src/auto/configure ---- vim80/src/auto/configure.python3-tests 2018-05-11 08:25:03.632420873 +0200 -+++ vim80/src/auto/configure 2018-05-11 09:25:26.062000471 +0200 -@@ -6396,7 +6396,7 @@ eof +diff -up vim82/src/auto/configure.python-tests vim82/src/auto/configure +--- vim82/src/auto/configure.python-tests 2020-04-17 06:07:48.000000000 +0200 ++++ vim82/src/auto/configure 2020-04-17 06:18:06.750977509 +0200 +@@ -6418,7 +6418,7 @@ eof if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" @@ -19,10 +19,10 @@ diff -up vim80/src/auto/configure.python3-tests vim80/src/auto/configure vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" fi else -diff -up vim80/src/configure.ac.python3-tests vim80/src/configure.ac ---- vim80/src/configure.ac.python3-tests 2018-05-11 08:25:26.070218957 +0200 -+++ vim80/src/configure.ac 2018-05-11 09:26:01.603708243 +0200 -@@ -1248,7 +1248,7 @@ eof +diff -up vim82/src/configure.ac.python-tests vim82/src/configure.ac +--- vim82/src/configure.ac.python-tests 2020-04-17 06:07:48.000000000 +0200 ++++ vim82/src/configure.ac 2020-04-17 06:18:06.750977509 +0200 +@@ -1263,7 +1263,7 @@ eof if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then vi_cv_path_python_plibs="-framework Python" @@ -31,54 +31,54 @@ diff -up vim80/src/configure.ac.python3-tests vim80/src/configure.ac vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python" fi else -diff -up vim80/src/testdir/test_channel_pipe.py.python3-tests vim80/src/testdir/test_channel_pipe.py ---- vim80/src/testdir/test_channel_pipe.py.python3-tests 2018-05-11 09:23:05.738146018 +0200 -+++ vim80/src/testdir/test_channel_pipe.py 2018-05-11 09:26:37.354413350 +0200 +diff -up vim82/src/testdir/test_channel_pipe.py.python-tests vim82/src/testdir/test_channel_pipe.py +--- vim82/src/testdir/test_channel_pipe.py.python-tests 2019-07-26 07:58:53.000000000 +0200 ++++ vim82/src/testdir/test_channel_pipe.py 2020-04-17 06:18:06.751977500 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Server that will communicate over stdin/stderr # -diff -up vim80/src/testdir/test_channel.py.python3-tests vim80/src/testdir/test_channel.py ---- vim80/src/testdir/test_channel.py.python3-tests 2018-05-11 09:22:48.522284266 +0200 -+++ vim80/src/testdir/test_channel.py 2018-05-11 09:26:17.762574955 +0200 +diff -up vim82/src/testdir/test_channel.py.python-tests vim82/src/testdir/test_channel.py +--- vim82/src/testdir/test_channel.py.python-tests 2020-04-17 06:18:06.751977500 +0200 ++++ vim82/src/testdir/test_channel.py 2020-04-17 06:18:24.517813082 +0200 @@ -1,4 +1,4 @@ --#!/usr/bin/python +-#!/usr/bin/env python +#!/usr/bin/python3 # # Server that will accept connections from a Vim channel. # Used by test_channel.vim. -diff -up vim80/src/testdir/test_channel_write.py.python3-tests vim80/src/testdir/test_channel_write.py ---- vim80/src/testdir/test_channel_write.py.python3-tests 2018-05-11 09:23:21.254021422 +0200 -+++ vim80/src/testdir/test_channel_write.py 2018-05-11 09:26:54.952268193 +0200 +diff -up vim82/src/testdir/test_channel_write.py.python-tests vim82/src/testdir/test_channel_write.py +--- vim82/src/testdir/test_channel_write.py.python-tests 2019-07-26 07:58:53.000000000 +0200 ++++ vim82/src/testdir/test_channel_write.py 2020-04-17 06:18:06.751977500 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Program that writes a number to stdout repeatedly # -diff -up vim80/src/testdir/test_makeencoding.py.python3-tests vim80/src/testdir/test_makeencoding.py ---- vim80/src/testdir/test_makeencoding.py.python3-tests 2018-05-11 09:23:38.990878990 +0200 -+++ vim80/src/testdir/test_makeencoding.py 2018-05-11 09:27:14.402107759 +0200 +diff -up vim82/src/testdir/test_makeencoding.py.python-tests vim82/src/testdir/test_makeencoding.py +--- vim82/src/testdir/test_makeencoding.py.python-tests 2019-07-26 07:58:53.000000000 +0200 ++++ vim82/src/testdir/test_makeencoding.py 2020-04-17 06:18:06.751977500 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- coding: utf-8 -*- # Test program for :make, :grep and :cgetfile. -diff -up vim80/src/testdir/test_netbeans.py.python3-tests vim80/src/testdir/test_netbeans.py ---- vim80/src/testdir/test_netbeans.py.python3-tests 2018-05-11 09:23:54.398752732 +0200 -+++ vim80/src/testdir/test_netbeans.py 2018-05-11 09:27:30.489975057 +0200 +diff -up vim82/src/testdir/test_netbeans.py.python-tests vim82/src/testdir/test_netbeans.py +--- vim82/src/testdir/test_netbeans.py.python-tests 2019-07-26 07:58:53.000000000 +0200 ++++ vim82/src/testdir/test_netbeans.py 2020-04-17 06:18:06.751977500 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Server that will communicate with Vim through the netbeans interface. # Used by test_netbeans.vim. -diff -up vim80/src/testdir/test_short_sleep.py.python3-tests vim80/src/testdir/test_short_sleep.py ---- vim80/src/testdir/test_short_sleep.py.python3-tests 2018-05-11 09:24:09.134631798 +0200 -+++ vim80/src/testdir/test_short_sleep.py 2018-05-11 09:27:48.432827053 +0200 +diff -up vim82/src/testdir/test_short_sleep.py.python-tests vim82/src/testdir/test_short_sleep.py +--- vim82/src/testdir/test_short_sleep.py.python-tests 2019-07-26 07:58:53.000000000 +0200 ++++ vim82/src/testdir/test_short_sleep.py 2020-04-17 06:18:06.751977500 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 diff --git a/vim.spec b/vim.spec index af6384bc0c7965556fcb6ab726f4c775ce54e616..aa4118050059f6d3f0a1c53450601dce9f00112f 100644 --- a/vim.spec +++ b/vim.spec @@ -6,175 +6,79 @@ %{!?_with_lua__:%define _with_lua__ 1} %{!?_with_netbeans__:%define _with_netbeans__ 1} -%define vimdir vim82 +%define vimdir vim90 +%define python_ver %{python3_version} Name: vim Epoch: 2 -Version: 8.2 -Release: 63 +Version: 9.0 +Release: 1 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 -Source0: ftp://ftp.vim.org/pub/vim/unix/vim-8.2.tar.bz2 +Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{version}.tar.bz2 Source1: virc Source2: vimrc Patch0000: vim-7.0-fixkeys.patch Patch0001: vim-7.4-specsyntax.patch -Patch0002: vim-7.4-syntax.patch -Patch0003: vim-7.4-nowarnings.patch -Patch0004: vim-7.0-rclocation.patch -Patch0005: vim-7.4-checkhl.patch Patch0006: vim-7.4-fstabsyntax.patch -Patch0007: vim-7.4-syncolor.patch Patch0009: vim-7.4-globalsyntax.patch -Patch0010: vim-7.4-releasestring-1318991.patch Patch0011: vim-8.0-copy-paste.patch Patch0012: vim-python3-tests.patch -Patch6000: backport-CVE-2021-3770.patch -Patch6001: backport-memory-leak-for-retab-with-invalid-argument.patch -Patch6003: backport-CVE-2021-3778.patch -Patch6004: backport-CVE-2021-3796.patch -Patch6005: backport-CVE-2021-3872.patch -Patch6006: backport-CVE-2021-3875.patch -Patch6007: backport-CVE-2021-3903.patch -Patch6008: backport-CVE-2021-3927.patch -Patch6009: backport-cannot-use-z-when-spell-is-off.patch -Patch6010: backport-CVE-2021-3928.patch -Patch6011: backport-CVE-2021-3973.patch -Patch6012: backport-CVE-2021-3974.patch -Patch6013: backport-find-test-fails.patch -Patch6014: backport-no-early-check-if-find-and-sfind-have-an-argument.patch -Patch6015: backport-CVE-2021-3984.patch -Patch6016: backport-CVE-2021-4019.patch -Patch6017: backport-CVE-2021-4069.patch -Patch6018: backport-missing-error-message.patch -Patch6019: backport-fix-giving-the-error-0-more-files-to-edit.patch -Patch6020: backport-add-the-arglist_locked-flag.patch -Patch6021: backport-CVE-2021-4166.patch -Patch6022: backport-fix-arglist-test-fails.patch -Patch6023: backport-CVE-2021-4192.patch -Patch6024: backport-CVE-2021-4193.patch -Patch6025: backport-CVE-2022-0213.patch -Patch6026: backport-CVE-2022-0261.patch -Patch6027: backport-vim-fix-garbled-characters-display-when-file-name-ma.patch -Patch6028: backport-CVE-2022-0318.patch -Patch6029: backport-block-insert-with-double-wide-character-fails.patch -Patch6030: backport-CVE-2022-0351.patch -Patch6031: backport-CVE-2022-0408.patch -Patch6032: backport-CVE-2022-0361.patch -Patch6033: backport-command-line-editing-not-sufficiently-tested.patch -Patch6034: backport-CVE-2022-0359.patch -Patch6035: backport-CVE-2022-0413.patch -Patch6036: backport-CVE-2022-0368.patch -Patch6037: backport-CVE-2022-0443.patch -Patch6038: backport-invalid-argument-errmsg.patch -Patch6039: backport-CVE-2022-0417.patch -Patch6040: backport-invalid-memory-access-with-search-command.patch -Patch6041: backport-bracketed-paste-can-still-cause-invalid-memory-acces.patch -Patch6042: backport-CVE-2022-0392.patch -Patch6043: backport-CVE-2022-0319.patch -Patch6044: backport-CVE-2022-0554.patch -Patch6045: backport-crash-when-pasting-too-many-times.patch -Patch6046: backport-CVE-2022-0572.patch -Patch6047: backport-CVE-2022-0629.patch -Patch6048: backport-CVE-2022-0714.patch -Patch6049: backport-CVE-2022-0729.patch -Patch6050: backport-CVE-2022-0685.patch -Patch6051: backport-CVE-2022-0943.patch -Patch6052: backport-CVE-2022-1616.patch -Patch6053: backport-CVE-2022-1154.patch -Patch6054: backport-html-text-objects-are-not-fully-tested.patch -Patch6055: backport-CVE-2022-1629.patch -Patch6056: backport-insufficient-code-coverage-for-ex_docmd.c_functions.patch -Patch6057: backport-CVE-2022-1620.patch -Patch6058: backport-CVE-2022-1674.patch -Patch6059: backport-CVE-2022-1621.patch -Patch6060: backport-spell-test-fails-because-of-new-illegal-byte-check.patch -Patch6061: backport-CVE-2022-1619.patch -Patch6062: backport-CVE-2022-1733.patch -Patch6063: backport-CVE-2022-1735.patch -Patch6064: backport-CVE-2022-1796.patch -Patch6065: backport-patch-8.2.0614-get-ml_get-error-when-deleting-a-line.patch -Patch6066: backport-patch-8.2.0670-cannot-change-window-when-evaluating-.patch -Patch6067: backport-CVE-2022-1785.patch -Patch6068: backport-semicolon-search-dose-not-work-in-first-line.patch -Patch6069: backport-CVE-2022-1927.patch -Patch6070: backport-after-a-put-the-mark-is-on-the-last-byte.patch -Patch6071: backport-illegal-memory-access.patch -Patch6072: backport-CVE-2022-1886.patch -Patch6073: backport-CVE-2022-1851.patch -Patch6074: backport-CVE-2022-1898.patch -Patch6075: backport-CVE-2022-1942.patch -Patch6076: backport-fix-test-failed.patch -Patch6077: backport-CVE-2022-1897.patch -Patch6078: backport-CVE-2022-1968.patch -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 -Patch6087: backport-patch-8.2.0358-insufficient-testing-for-indent.c.patch -Patch6088: backport-CVE-2022-2125.patch -Patch6089: backport-CVE-2022-2206.patch -Patch6090: backport-patch-8.2.5161-might-still-access-invalid-memory.patch -Patch6091: backport-CVE-2022-1720.patch -Patch6092: backport-CVE-2022-2183.patch -Patch6093: backport-cannot-list-options-one-per-line.patch -Patch6094: backport-CVE-2022-2207.patch -Patch6095: backport-CVE-2022-2208.patch -Patch6096: backport-test-for-DiffUpdated-fails.patch -Patch6097: backport-CVE-2022-2000.patch -Patch6098: backport-CVE-2022-2042.patch -Patch6099: backport-CVE-2022-2284.patch -Patch6100: backport-CVE-2022-2285.patch -Patch6101: backport-CVE-2022-2304.patch -Patch6102: backport-CVE-2022-2344.patch -Patch6103: backport-CVE-2022-2345.patch -Patch6104: backport-CVE-2022-2264.patch -Patch6105: backport-patch-8.2.4867-listing-of-mapping-with-K_SPECIAL-is-.patch -Patch6106: backport-patch-8.2.4924-maparg-may-return-a-string-that-canno.patch -Patch6107: backport-CVE-2022-2257.patch -Patch6108: backport-CVE-2022-2286.patch -Patch6109: backport-CVE-2022-2287.patch -Patch6110: backport-patch-9.0.0022-spell-test-fails.patch -Patch6111: backport-CVE-2022-2210.patch -Patch6112: backport-CVE-2022-2289.patch -Patch6113: backport-patch-8.2.3953-insert-completion-code-is-too-complic.patch -Patch6114: backport-CVE-2022-2343.patch -Patch6115: backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-conversion.patch -Patch6116: backport-CVE-2022-2522.patch -Patch6117: backport-patch-8.2.0310-autocmd-test-fails-on-a-slow-system.patch -Patch6118: backport-CVE-2022-2598.patch -Patch6119: backport-CVE-2022-2571.patch -Patch6120: backport-CVE-2022-1725.patch -Patch6121: backport-CVE-2022-2845.patch -Patch6122: backport-CVE-2022-2923.patch -Patch6123: backport-CVE-2022-2946.patch -Patch6124: backport-CVE-2022-2980.patch -Patch6125: backport-patch-8.2.1677-memory-access-errors-when-calling-set.patch -Patch6126: backport-CVE-2022-3016.patch -Patch6127: backport-CVE-2022-3099.patch -Patch6128: backport-CVE-2022-3134.patch -Patch6129: backport-CVE-2022-3234.patch -Patch6130: backport-CVE-2022-3235.patch -Patch6131: backport-CVE-2022-3256.patch -Patch6132: backport-CVE-2022-3352.patch -Patch6133: backport-CVE-2022-3296.patch -Patch6134: backport-CVE-2022-3297.patch -Patch6135: backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch -Patch6136: backport-CVE-2022-3324.patch -Patch6137: backport-CVE-2022-3705.patch +Patch6000: backport-CVE-2022-2257.patch +Patch6001: backport-CVE-2022-2264.patch +Patch6002: backport-CVE-2022-2284.patch +Patch6003: backport-CVE-2022-2285.patch +Patch6004: backport-CVE-2022-2286.patch +Patch6005: backport-CVE-2022-2287.patch +Patch6006: backport-CVE-2022-2288.patch +Patch6007: backport-patch-9.0.0022-spell-test-fails.patch +Patch6008: backport-CVE-2022-2289.patch +Patch6009: backport-CVE-2022-2304.patch +Patch6010: backport-CVE-2022-2343.patch +Patch6011: backport-CVE-2022-2344.patch +Patch6012: backport-CVE-2022-2345.patch +Patch6013: backport-patch-9.0.0054-compiler-warning-for-size_t-to-int-co.patch +Patch6014: backport-CVE-2022-2522.patch +Patch6015: backport-CVE-2022-2598.patch +Patch6016: backport-CVE-2022-2571.patch +Patch6017: backport-CVE-2022-2580.patch +Patch6018: backport-CVE-2022-2581.patch +Patch6019: backport-CVE-2022-2819.patch +Patch6020: backport-CVE-2022-2816.patch +Patch6021: backport-CVE-2022-2817.patch +Patch6022: backport-CVE-2022-2845.patch +Patch6023: backport-CVE-2022-2849.patch +Patch6024: backport-CVE-2022-2862.patch +Patch6025: backport-CVE-2022-2874.patch +Patch6026: backport-CVE-2022-2889.patch +Patch6027: backport-CVE-2022-2923.patch +Patch6028: backport-CVE-2022-2946.patch +Patch6029: backport-CVE-2022-2980.patch +Patch6030: backport-CVE-2022-2982.patch +Patch6031: backport-CVE-2022-3016.patch +Patch6032: backport-CVE-2022-3037.patch +Patch6033: backport-CVE-2022-3099.patch +Patch6034: backport-CVE-2022-3134.patch +Patch6035: backport-CVE-2022-3153.patch +Patch6036: backport-CVE-2022-3234.patch +Patch6037: backport-CVE-2022-3235.patch +Patch6038: backport-CVE-2022-3256.patch +Patch6039: backport-CVE-2022-3296.patch +Patch6040: backport-CVE-2022-3352.patch +Patch6041: backport-spell-test-fails-because-error-message-changed.patch +Patch6042: backport-CVE-2022-3278.patch +Patch6043: backport-CVE-2022-3297.patch +Patch6044: backport-9.0.0581-adding-a-character-for-incsearch-fails-at-end-of-line.patch +Patch6045: backport-CVE-2022-3324.patch +Patch6046: backport-CVE-2022-3705.patch Patch9000: bugfix-rm-modify-info-version.patch -Patch9001: remove-failed-tests-due-to-patch.patch -BuildRequires: autoconf python-devel python3-devel ncurses-devel gettext perl-devel perl-generators +BuildRequires: autoconf python3-devel ncurses-devel gettext perl-devel perl-generators gcc BuildRequires: perl(ExtUtils::Embed) perl(ExtUtils::ParseXS) libacl-devel gpm-devel file -BuildRequires: desktop-file-utils >= 0.2.93 libtool chrpath +BuildRequires: desktop-file-utils >= 0.2.93 libtool make %if %{_with_selinux__} BuildRequires: libselinux-devel %endif @@ -214,7 +118,7 @@ The minimal package provides a minimal version of vim editor. It will be install Summary: This is a package containing enhanced vim editor. Requires: vim-common = %{epoch}:%{version}-%{release} which gpm-libs Provides: vim = %{version}-%{release} %{_bindir}/mergetool %{_bindir}/vim -Suggests: python2 python2-libs python3 python3-libs +Suggests: python3 python3-libs Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Suggests: perl-libs perl-devel %if %{_with_ruby__} @@ -240,7 +144,7 @@ BuildRequires: gtk3-devel libX11-devel libSM-devel libXt-devel libXpm-devel lib Requires: vim-common = %{epoch}:%{version}-%{release} libattr >= 2.4 gtk3 hicolor-icon-theme Requires: libICE libSM libX11 libXt cairo gdk-pixbuf2 pango Provides: gvim = %{version}-%{release} %{_bindir}/mergetool %{_bindir}/gvim -Suggests: python2 python2-libs python3 python3-libs +Suggests: python3 python3-libs Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Suggests: perl-libs perl-devel %if %{_with_ruby__} @@ -256,6 +160,9 @@ This X11 package serves you the ability to use vim with graphics and mouse. %prep %autosetup -b 0 -n %{vimdir} -p1 +#ipv6 test fail in CI, it should be related to the ipv6 configuration on jenkins, which is successful on openEuler obs +rm -rf src/testdir/test_channel.* + %build %define _make_cmd__() %{make_build} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}; cp vim %{?1}; %{!?2:make clean} @@ -271,7 +178,7 @@ sed -i 's/vimrc/virc/' os_unix.h %configure --with-features=small --with-x=no --enable-multibyte --disable-netbeans \ --disable-pythoninterp --disable-perlinterp --disable-tclinterp --with-tlib=ncurses \ --enable-gui=no --disable-gpm --exec-prefix=/ \ - --enable-fail-if-missing \ + --enable-fail-if-missing --with-python3-config-dir=/usr/lib64/python%{python_ver}/config-%{python_ver}-%{_arch}-linux-gnu \ %if %{_with_selinux__} --enable-selinux \ %else @@ -282,10 +189,10 @@ sed -i 's/vimrc/virc/' os_unix.h mv os_unix.h.bak os_unix.h -%configure --with-features=huge --enable-pythoninterp=dynamic --enable-python3interp=dynamic \ +%configure --with-features=huge --enable-python3interp=dynamic \ --enable-perlinterp=dynamic --disable-tclinterp --with-x=yes --enable-xim --enable-multibyte \ --with-tlib=ncurses --enable-gtk3-check --enable-gui=gtk3 \ - --enable-cscope --enable-fail-if-missing \ + --enable-cscope --enable-fail-if-missing --with-python3-config-dir=/usr/lib64/python%{python_ver}/config-%{python_ver}-%{_arch}-linux-gnu \ %if %{_with_netbeans__} --enable-netbeans \ %else @@ -309,9 +216,9 @@ mv os_unix.h.bak os_unix.h %{_make_cmd__ vim-X11} -%configure --with-features=huge --enable-pythoninterp=dynamic --enable-python3interp=dynamic \ +%configure --with-features=huge --enable-python3interp=dynamic \ --enable-perlinterp=dynamic --disable-tclinterp --with-x=no --enable-gui=no --enable-multibyte \ - --enable-cscope --with-tlib=ncurses \ + --enable-cscope --with-tlib=ncurses --with-python3-config-dir=/usr/lib64/python%{python_ver}/config-%{python_ver}-%{_arch}-linux-gnu \ --enable-fail-if-missing \ %if %{_with_netbeans__} --enable-netbeans \ @@ -452,12 +359,6 @@ echo ".so man1/vimtutor.1" > %{buildroot}%{_mandir}/man1/gvimtutor.1 echo ".so man1/vi.1" > %{buildroot}%{_mandir}/man5/virc.5 touch %{buildroot}%{_datadir}/%{name}/vimfiles/doc/tags -chrpath -d %{buildroot}%{_bindir}/vim -chrpath -d %{buildroot}%{_bindir}/xxd - -mkdir -p %{buildroot}/etc/ld.so.conf.d -echo "{_libdir}/perl5/CORE" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf - pushd runtime ln -sf ../../%{name}/%{vimdir}/doc docs popd @@ -470,9 +371,7 @@ popd %{_bindir}/vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null || : %check -export TERM=linux -# Reset the terminal scrolling region left behind by the testsuite -trap "printf '\e[r'" EXIT +export TERM=xterm LC_ALL=en_US.UTF-8 make -j1 test %files common @@ -490,6 +389,7 @@ LC_ALL=en_US.UTF-8 make -j1 test %{_datadir}/%{name}/%{vimdir}/{*.vim,ftplugin,indent,keymap,macros,plugin} %{_datadir}/%{name}/%{vimdir}/{print,syntax,tutor,spell} %{_datadir}/%{name}/%{vimdir}/lang/{*.vim,*.txt} +%{_datadir}/%{name}/%{vimdir}/import/dist/vimhelp.vim %{_bindir}/xxd %lang(af) %{_datadir}/%{name}/%{vimdir}/lang/af %lang(ca) %{_datadir}/%{name}/%{vimdir}/lang/ca @@ -539,20 +439,22 @@ LC_ALL=en_US.UTF-8 make -j1 test %lang(ja) %{_mandir}/ja/man1/* %lang(pl) %{_mandir}/pl/man1/* %lang(ru) %{_mandir}/ru/man1/* +%lang(tr) %{_mandir}/tr/man1/* +%lang(tr.ISO8859-9) %{_mandir}/tr.ISO8859-9/man1/* +%lang(tr.UTF-8) %{_mandir}/tr.UTF-8/man1/* %{_mandir}/man1/{gex.*,gview.*,gvim*,rvim.*,vim.*,vimdiff.*} %{_mandir}/man1/{vimtutor.*,vimx.*,xxd.*} %{_mandir}/man5/vimrc.* -%config(noreplace) /etc/ld.so.conf.d/* %files minimal %config(noreplace) %{_sysconfdir}/virc %{_bindir}/{ex,vi,view,rvi,rview} %{_mandir}/man1/{vi.*,ex.*,rvi.*,rview.*,view.*} %{_mandir}/man5/virc.* +%{_datadir}/%{name}/%{vimdir}/defaults.vim %files enhanced %{_bindir}/{vim,rvim,vimdiff,vimtutor} -%config(noreplace) /etc/ld.so.conf.d/* %files filesystem %dir %{_datadir}/%{name}/vimfiles/after/* @@ -570,6 +472,12 @@ LC_ALL=en_US.UTF-8 make -j1 test %{_mandir}/man1/evim.* %changelog +* Thu Nov 03 2022 wangjiang - 2:9.0-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:upgrade version to 9.0 + * Mon Oct 31 2022 wangjiang - 2:8.2-63 - Type:CVE - ID:CVE-2022-3705 diff --git a/vim.yaml b/vim.yaml new file mode 100644 index 0000000000000000000000000000000000000000..706d40e18bcbf62c9189bfda18b28d4ab578f604 --- /dev/null +++ b/vim.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: vim/vim +tag_prefix: ^v +seperator: . \ No newline at end of file