mirror of
https://github.com/tpope/vim-fugitive.git
synced 2026-10-07 20:54:39 +08:00
Improve cmd.exe shell escaping
This commit is contained in:
1 parent
60fdd95b95
commit
1b6c0cbfb6
1 file changed
+2
-2
+2
-2
@@ -29,8 +29,8 @@ endfunction
|
||||
function! s:shellesc(arg) abort
|
||||
if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
|
||||
return a:arg
|
||||
elseif &shell =~# 'cmd' && a:arg !~# '"'
|
||||
return '"'.a:arg.'"'
|
||||
elseif &shell =~# 'cmd'
|
||||
return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"'
|
||||
else
|
||||
return shellescape(a:arg)
|
||||
endif
|
||||
|
||||
Reference in new issue
Block a user