Created
September 3, 2009 02:30
-
-
Save thinca/180086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: sexe.vim | |
=================================================================== | |
--- sexe.vim (リビジョン 518) | |
+++ sexe.vim (作業コピー) | |
@@ -40,10 +40,21 @@ | |
function! vimshell#internal#sexe#execute(program, args, fd, other_info)"{{{ | |
" Execute shell command. | |
let l:cmdline = '' | |
+ let l:iswin = has('win32') || has('win64') | |
for arg in a:args | |
- let l:cmdline .= substitute(arg, '"', '\\""', 'g') . ' ' | |
+ if l:iswin | |
+ let l:arg = substitute(arg, '"', '\\"', 'g') | |
+ let l:arg = substitute(arg, '[<>|^]', '^\0', 'g') | |
+ let l:cmdline .= '"' . arg . '" ' | |
+ else | |
+ let l:cmdline .= shellescape(arg) . ' ' | |
+ endif | |
endfor | |
+ if l:iswin | |
+ let l:cmdline = '"' . l:cmdline . '"' | |
+ endif | |
+ | |
" Set redirection. | |
if a:fd.stdin == '' | |
let l:stdin = '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment