From ebc7f69d928420f8957188aea64cd57f8ed30334 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:39:19 +0800 Subject: vim-patch:8.0.0530: buffer overflow when 'columns' is very big Problem: Buffer overflow when 'columns' is very big. (Nikolai Pavlov) Solution: Correctly compute where to truncate. Fix translation. (closes vim/vim#1600) https://github.com/vim/vim/commit/658a3a2caf5852d071b6b1be92d9d6614a6208dc --- src/nvim/testdir/test_edit.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 8f815478c2..ae0404ea6c 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1323,3 +1323,23 @@ func Test_edit_quit() only endfunc +func Test_edit_complete_very_long_name() + let save_columns = &columns + set columns=5000 + call assert_equal(5000, &columns) + set noswapfile + let dirname = getcwd() . "/Xdir" + let longdirname = dirname . repeat('/' . repeat('d', 255), 4) + let longfilename = longdirname . '/' . repeat('a', 255) + call mkdir(longdirname, 'p') + call writefile(['Totum', 'Table'], longfilename) + new + exe "next Xfile " . longfilename + exe "normal iT\" + + bwipe! + exe 'bwipe! ' . longfilename + call delete(dirname, 'rf') + let &columns = save_columns + set swapfile& +endfunc -- cgit From 9a1234e57f404638f0e040323b0097a6dc38e17f Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:40:29 +0800 Subject: vim-patch:8.0.0531: test with long directory name fails on non-unix systems Problem: Test with long directory name fails on non-unix systems. Solution: Skip the test on non-unix systems. https://github.com/vim/vim/commit/9b81079ddd839a666682f6bdbc24890bf4d1a42c --- src/nvim/testdir/test_edit.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index ae0404ea6c..daa86a2f80 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1324,6 +1324,10 @@ func Test_edit_quit() endfunc func Test_edit_complete_very_long_name() + if !has('unix') + " Long directory names only work on Unix. + return + endif let save_columns = &columns set columns=5000 call assert_equal(5000, &columns) -- cgit From 264725c25fecd7f30d1386cc20042cfcf4e43b9e Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:40:58 +0800 Subject: vim-patch:8.0.0532: test with long directory name fails on Mac Problem: Test with long directory name fails on Mac. Solution: Skip the test on Mac systems. https://github.com/vim/vim/commit/c77d6757471fa207520586bbdbc1b30af84cf5c8 --- src/nvim/testdir/test_edit.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index daa86a2f80..9275acd09d 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1324,7 +1324,7 @@ func Test_edit_quit() endfunc func Test_edit_complete_very_long_name() - if !has('unix') + if !has('unix') || has('mac') " Long directory names only work on Unix. return endif -- cgit From 3ff1907593ab46d7a4da6b527d60608ca740c4dd Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:41:44 +0800 Subject: vim-patch:8.0.0543: test_edit causes older xfce4-terminal to close Problem: Test_edit causes older xfce4-terminal to close. (Dominique Pelle) Solution: Reduce number of columns to 2000. Try to restore the window position. https://github.com/vim/vim/commit/ba6ec182973af726ce9b7b7eb3753fc3a7ae7d1b --- src/nvim/testdir/test_edit.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 9275acd09d..556b019bb1 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1328,10 +1328,14 @@ func Test_edit_complete_very_long_name() " Long directory names only work on Unix. return endif + " Try to get the Vim window position before setting 'columns'. + let winposx = getwinposx() + let winposy = getwinposy() let save_columns = &columns - set columns=5000 - call assert_equal(5000, &columns) + set columns=2000 + call assert_equal(2000, &columns) set noswapfile + let dirname = getcwd() . "/Xdir" let longdirname = dirname . repeat('/' . repeat('d', 255), 4) let longfilename = longdirname . '/' . repeat('a', 255) @@ -1345,5 +1349,8 @@ func Test_edit_complete_very_long_name() exe 'bwipe! ' . longfilename call delete(dirname, 'rf') let &columns = save_columns + if winposx >= 0 && winposy >= 0 + exe 'winpos ' . winposx . ' ' . winposy + endif set swapfile& endfunc -- cgit From bbf00120f7afb427fdd44844f55ffbc5d7b8e830 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:42:30 +0800 Subject: vim-patch:8.0.0545: edit test may fail on some systems Problem: Edit test may fail on some systems. Solution: If creating a directory with a very long path fails, bail out. https://github.com/vim/vim/commit/15ecbd6f3d39ff04862999a577962ef9369a9e53 --- src/nvim/testdir/test_edit.vim | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 556b019bb1..d2474c06fe 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1324,22 +1324,31 @@ func Test_edit_quit() endfunc func Test_edit_complete_very_long_name() - if !has('unix') || has('mac') + if !has('unix') " Long directory names only work on Unix. return endif + + let dirname = getcwd() . "/Xdir" + let longdirname = dirname . repeat('/' . repeat('d', 255), 4) + try + call mkdir(longdirname, 'p') + catch /E739:/ + " Long directory name probably not supported. + call delete(dirname, 'rf') + return + endtry + " Try to get the Vim window position before setting 'columns'. let winposx = getwinposx() let winposy = getwinposy() let save_columns = &columns + " Need at least about 1100 columns to reproduce the problem. set columns=2000 call assert_equal(2000, &columns) set noswapfile - let dirname = getcwd() . "/Xdir" - let longdirname = dirname . repeat('/' . repeat('d', 255), 4) let longfilename = longdirname . '/' . repeat('a', 255) - call mkdir(longdirname, 'p') call writefile(['Totum', 'Table'], longfilename) new exe "next Xfile " . longfilename -- cgit