To: vim_dev@googlegroups.com Subject: Patch 8.1.0476 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0476 Problem: Memory leaks in test_escaped_glob. Solution: Avoid failure when running the shell, use the sandbox. Files: src/testdir/test_escaped_glob.vim *** ../vim-8.1.0475/src/testdir/test_escaped_glob.vim 2017-12-07 22:05:10.000000000 +0100 --- src/testdir/test_escaped_glob.vim 2018-10-14 22:02:01.544686099 +0200 *************** *** 2,9 **** " characters. function SetUp() - " make sure glob() doesn't use the shell - set shell=doesnotexist " consistent sorting of file names set nofileignorecase endfunction --- 2,7 ---- *************** *** 14,32 **** " filenames. Disable the test on non-Unix systems for now. return endif ! call assert_equal("", glob('Xxx\{')) ! call assert_equal("", glob('Xxx\$')) w! Xxx{ w! Xxx\$ ! call assert_equal("Xxx{", glob('Xxx\{')) ! call assert_equal("Xxx$", glob('Xxx\$')) call delete('Xxx{') call delete('Xxx$') endfunction function Test_globpath() ! call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim", \ globpath('sautest/autoload', 'glob*.vim')) ! call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'], \ globpath('sautest/autoload', 'glob*.vim', 0, 1)) endfunction --- 12,33 ---- " filenames. Disable the test on non-Unix systems for now. return endif ! ! " Execute these commands in the sandbox, so that using the shell fails. ! " Setting 'shell' to an invalid name causes a memory leak. ! sandbox call assert_equal("", glob('Xxx\{')) ! sandbox call assert_equal("", glob('Xxx\$')) w! Xxx{ w! Xxx\$ ! sandbox call assert_equal("Xxx{", glob('Xxx\{')) ! sandbox call assert_equal("Xxx$", glob('Xxx\$')) call delete('Xxx{') call delete('Xxx$') endfunction function Test_globpath() ! sandbox call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim", \ globpath('sautest/autoload', 'glob*.vim')) ! sandbox call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'], \ globpath('sautest/autoload', 'glob*.vim', 0, 1)) endfunction *** ../vim-8.1.0475/src/version.c 2018-10-14 21:40:57.356848425 +0200 --- src/version.c 2018-10-14 22:03:06.948104382 +0200 *************** *** 794,795 **** --- 794,797 ---- { /* Add new patch number below this line */ + /**/ + 476, /**/ -- panic("Foooooooood fight!"); -- In the kernel source aha1542.c, after detecting a bad segment list /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///