Skip to content

Commit b97fab5

Browse files
authored
Do NOT escape executable (#80)
1 parent 04469d8 commit b97fab5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/suda.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
" Returns a string that is safe to pass to `system` on both vim and neovim
77
function! s:get_command(opts, cmd)
88
if g:suda#executable ==# 'sudo'
9-
let ret = [g:suda#executable] + a:opts + ['--'] + a:cmd
9+
let ret = a:opts + ['--'] + a:cmd
1010
else
1111
" TODO:
1212
" Should we pass '--' before cmd when using a custom suda#executable?
1313
" Should suda#executable be split? Should we allow suda#executable to be a list instead?
1414
" This behavior is entirely undocumented
15-
let ret = [g:suda#executable] + a:cmd
15+
let ret = a:cmd
1616
endif
1717

1818
" TODO: Should we detect `has('neovim')` and return a list to avoid a shell?
19-
return join(map(ret, { k, v -> shellescape(v) }), ' ')
19+
return join([g:suda#executable] + map(ret, { k, v -> shellescape(v) }), ' ')
2020
endfunction
2121

2222
" {cmd} is a argv list for the process

0 commit comments

Comments
 (0)