From: Bob Hiestand Date: Thu, 11 Apr 2013 19:25:06 +0000 (-0500) Subject: re-enable executable quoting removed in 1.99.43. X-Git-Tag: v1.99.47~2 X-Git-Url: https://repo.or.cz/w/vcscommand.git/commitdiff_plain/4953287bf75a5c2c704d2b3c30c85843787ae405 re-enable executable quoting removed in 1.99.43. Remove special-casing of sxq for Windows, as VIM does that now. Always call shellescape() on the executable name in s:Executable(). --- diff --git a/plugin/vcsbzr.vim b/plugin/vcsbzr.vim index 966f2ee..2e9c53b 100644 --- a/plugin/vcsbzr.vim +++ b/plugin/vcsbzr.vim @@ -65,7 +65,7 @@ let s:bzrFunctions = {} " Returns the executable used to invoke bzr suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandBZRExec', 'bzr') + return shellescape(VCSCommandGetOption('VCSCommandBZRExec', 'bzr')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText) {{{2 diff --git a/plugin/vcscommand.vim b/plugin/vcscommand.vim index 2726436..e88e3af 100644 --- a/plugin/vcscommand.vim +++ b/plugin/vcscommand.vim @@ -378,31 +378,21 @@ endfunction " command line on Windows systems. function! s:VCSCommandUtility.system(...) - if (has("win32") || has("win64")) && &sxq !~ '"' - let save_sxq = &sxq - set sxq=\" - endif - try - let output = call('system', a:000) - if exists('*iconv') && has('multi_byte') - if(strlen(&tenc) && &tenc != &enc) - let output = iconv(output, &tenc, &enc) - else - let originalBuffer = VCSCommandGetOriginalBuffer(VCSCommandGetOption('VCSCommandEncodeAsFile', 0)) - if originalBuffer - let fenc = getbufvar(originalBuffer, '&fenc') - if fenc != &enc - let output = iconv(output, fenc, &enc) - endif + let output = call('system', a:000) + if exists('*iconv') && has('multi_byte') + if(strlen(&tenc) && &tenc != &enc) + let output = iconv(output, &tenc, &enc) + else + let originalBuffer = VCSCommandGetOriginalBuffer(VCSCommandGetOption('VCSCommandEncodeAsFile', 0)) + if originalBuffer + let fenc = getbufvar(originalBuffer, '&fenc') + if fenc != &enc + let output = iconv(output, fenc, &enc) endif endif - - endif - finally - if exists("save_sxq") - let &sxq = save_sxq endif - endtry + + endif return output endfunction diff --git a/plugin/vcscvs.vim b/plugin/vcscvs.vim index 11c7433..fe6db21 100644 --- a/plugin/vcscvs.vim +++ b/plugin/vcscvs.vim @@ -111,7 +111,7 @@ let s:cvsFunctions = {} " Returns the executable used to invoke cvs suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandCVSExec', 'cvs') + return shellescape(VCSCommandGetOption('VCSCommandCVSExec', 'cvs')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 diff --git a/plugin/vcsgit.vim b/plugin/vcsgit.vim index 2667982..a893d15 100644 --- a/plugin/vcsgit.vim +++ b/plugin/vcsgit.vim @@ -70,7 +70,7 @@ let s:gitFunctions = {} " Returns the executable used to invoke git suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandGitExec', 'git') + return shellescape(VCSCommandGetOption('VCSCommandGitExec', 'git')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 diff --git a/plugin/vcshg.vim b/plugin/vcshg.vim index 775ede0..9dbbde8 100644 --- a/plugin/vcshg.vim +++ b/plugin/vcshg.vim @@ -72,7 +72,7 @@ let s:hgFunctions = {} " Returns the executable used to invoke hg suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandHGExec', 'hg') + return shellescape(VCSCommandGetOption('VCSCommandHGExec', 'hg')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 diff --git a/plugin/vcssvk.vim b/plugin/vcssvk.vim index bee84c3..f04c9cc 100644 --- a/plugin/vcssvk.vim +++ b/plugin/vcssvk.vim @@ -65,7 +65,7 @@ let s:svkFunctions = {} " Returns the executable used to invoke SVK suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandSVKExec', 'svk') + return shellescape(VCSCommandGetOption('VCSCommandSVKExec', 'svk')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 diff --git a/plugin/vcssvn.vim b/plugin/vcssvn.vim index 8ad6388..a7fe7e5 100644 --- a/plugin/vcssvn.vim +++ b/plugin/vcssvn.vim @@ -72,7 +72,7 @@ let s:svnFunctions = {} " Returns the executable used to invoke git suitable for use in a shell " command. function! s:Executable() - return VCSCommandGetOption('VCSCommandSVNExec', 'svn') + return shellescape(VCSCommandGetOption('VCSCommandSVNExec', 'svn')) endfunction " Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2