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 new file mode 100644 index 0000000000000000000000000000000000000000..3723e415c79702caeca54c23fd7c744dbee324a8 --- /dev/null +++ b/backport-vim-fix-garbled-characters-display-when-file-name-ma.patch @@ -0,0 +1,37 @@ +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/vim.spec b/vim.spec index 5d4d9edad30b03cf7a9a8b1208943c039aa3181e..f13a20b56114aca1dfa0f23ca62d57d996ac92a3 100644 --- a/vim.spec +++ b/vim.spec @@ -12,7 +12,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 18 +Release: 19 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 @@ -52,6 +52,7 @@ 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-vim-fix-garbled-characters-display-when-file-name-ma.patch Patch9000: bugfix-rm-modify-info-version.patch @@ -440,6 +441,12 @@ popd %{_mandir}/man1/evim.* %changelog +* Mon Jan 24 2022 yuanxin - 2:8.2-19 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix garbled characters display when file name matches warning or error in tar file + * Sat Dec 11 2021 yuanxin - 2:8.2-18 - Type:CVE - ID:CVE-2021-4069