To: vim_dev@googlegroups.com Subject: Patch 7.4.1643 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1643 (after 7.4.1641) Problem: Terminating file name has side effects. Solution: Restore the character. (mostly by James McCoy, closes #713) Files: src/eval.c, src/testdir/test105.in, src/testdir/test105.ok *** ../vim-7.4.1642/src/eval.c 2016-03-23 22:28:20.940072694 +0100 --- src/eval.c 2016-03-24 19:09:30.796172120 +0100 *************** *** 26440,26447 **** --- 26440,26449 ---- if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') { /* vim_strsave_shellescape() needs a NUL terminated string. */ + c = (*fnamep)[*fnamelen]; (*fnamep)[*fnamelen] = NUL; p = vim_strsave_shellescape(*fnamep, FALSE, FALSE); + (*fnamep)[*fnamelen] = c; if (p == NULL) return -1; vim_free(*bufp); *** ../vim-7.4.1642/src/testdir/test105.in 2016-03-23 22:28:20.940072694 +0100 --- src/testdir/test105.in 2016-03-24 19:07:56.161138770 +0100 *************** *** 36,41 **** --- 36,42 ---- :Put fnamemodify('abc''%''def', ':S' ) :Put fnamemodify("abc\ndef", ':S' ) :Put expand('%:r:S') == shellescape(expand('%:r')) + :Put join([expand('%:r'), expand('%:r:S'), expand('%')], ',') :set shell=tcsh :Put fnamemodify("abc\ndef", ':S' ) :$put ='vim: ts=8' *** ../vim-7.4.1642/src/testdir/test105.ok 2016-03-23 22:28:20.940072694 +0100 --- src/testdir/test105.ok 2016-03-24 19:07:56.161138770 +0100 *************** *** 26,30 **** --- 26,31 ---- fnamemodify('abc''%''def', ':S' ) '''abc''\''''%''\''''def''' fnamemodify("abc\ndef", ':S' ) '''abc^@def''' expand('%:r:S') == shellescape(expand('%:r')) 1 + join([expand('%:r'), expand('%:r:S'), expand('%')], ',') 'test105,''test105'',test105.in' fnamemodify("abc\ndef", ':S' ) '''abc\^@def''' vim: ts=8 *** ../vim-7.4.1642/src/version.c 2016-03-24 18:24:54.011501774 +0100 --- src/version.c 2016-03-24 19:11:21.147045101 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1643, /**/ -- Nobody will ever need more than 640 kB RAM. -- Bill Gates, 1983 Windows 98 requires 16 MB RAM. -- Bill Gates, 1999 Logical conclusion: Nobody will ever need Windows 98. /// 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 ///