mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Improve cmd.exe shell escaping
This commit is contained in:
@@ -29,8 +29,8 @@ endfunction
|
|||||||
function! s:shellesc(arg) abort
|
function! s:shellesc(arg) abort
|
||||||
if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
|
if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
|
||||||
return a:arg
|
return a:arg
|
||||||
elseif &shell =~# 'cmd' && a:arg !~# '"'
|
elseif &shell =~# 'cmd'
|
||||||
return '"'.a:arg.'"'
|
return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"'
|
||||||
else
|
else
|
||||||
return shellescape(a:arg)
|
return shellescape(a:arg)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user