To: vim_dev@googlegroups.com Subject: Patch 8.0.0442 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0442 Problem: Patch shell command uses double quotes around the argument, which allows for $HOME to be expanded. (Etienne) Solution: Use single quotes on Unix. (closes #1543) Files: src/diff.c, src/testdir/test_diffmode.vim *** ../vim-8.0.0441/src/diff.c 2017-03-05 21:18:21.877452188 +0100 --- src/diff.c 2017-03-09 19:16:13.365488797 +0100 *************** *** 977,983 **** { /* Build the patch command and execute it. Ignore errors. Switch to * cooked mode to allow the user to respond to prompts. */ ! vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig, # ifdef UNIX fullname != NULL ? fullname : --- 977,988 ---- { /* Build the patch command and execute it. Ignore errors. Switch to * cooked mode to allow the user to respond to prompts. */ ! vim_snprintf((char *)buf, buflen, ! #ifdef UNIX ! "patch -o %s %s < '%s'", ! #else ! "patch -o %s %s < \"%s\"", ! #endif tmp_new, tmp_orig, # ifdef UNIX fullname != NULL ? fullname : *** ../vim-8.0.0441/src/testdir/test_diffmode.vim 2017-03-08 22:55:14.914181221 +0100 --- src/testdir/test_diffmode.vim 2017-03-09 19:13:26.878658438 +0100 *************** *** 318,326 **** bwipe! new call assert_fails('diffpatch Xpatch', 'E816:') ! call setline(1, ['1', '2', '3']) ! diffpatch Xpatch ! call assert_equal(['1', '2x', '3', '4'], getline(1, '$')) call delete('Xpatch') bwipe! endfunc --- 318,337 ---- bwipe! new call assert_fails('diffpatch Xpatch', 'E816:') ! ! for name in ['Xpatch', 'Xpatch$HOME'] ! call setline(1, ['1', '2', '3']) ! if name != 'Xpatch' ! call rename('Xpatch', name) ! endif ! exe 'diffpatch ' . escape(name, '$') ! call assert_equal(['1', '2x', '3', '4'], getline(1, '$')) ! if name != 'Xpatch' ! call rename(name, 'Xpatch') ! endif ! bwipe! ! endfor ! call delete('Xpatch') bwipe! endfunc *** ../vim-8.0.0441/src/version.c 2017-03-09 18:59:05.660711160 +0100 --- src/version.c 2017-03-09 19:01:01.659895667 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 442, /**/ -- From "know your smileys": :-D Big smile /// 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 ///