mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 15:23:51 -05:00
Use absolute path to /usr/bin/env
Based on the prevalence of /usr/bin/env shebangs, I trust it is safe to hard code this. Or at least, it's safer than trusting the user not to create a script called env.
This commit is contained in:
@@ -251,7 +251,7 @@ function! s:GitCmd() abort
|
|||||||
let string = g:fugitive_git_executable
|
let string = g:fugitive_git_executable
|
||||||
let list = []
|
let list = []
|
||||||
if string =~# '^\w\+='
|
if string =~# '^\w\+='
|
||||||
call add(list, 'env')
|
call add(list, '/usr/bin/env')
|
||||||
endif
|
endif
|
||||||
while string =~# '\S'
|
while string =~# '\S'
|
||||||
let arg = matchstr(string, '^\s*\%(' . dquote . '''[^'']*''\|\\.\|[^[:space:] |]\)\+')
|
let arg = matchstr(string, '^\s*\%(' . dquote . '''[^'']*''\|\\.\|[^[:space:] |]\)\+')
|
||||||
@@ -479,7 +479,7 @@ function! s:BuildEnvPrefix(env) abort
|
|||||||
elseif s:winshell()
|
elseif s:winshell()
|
||||||
return join(map(env, '"set " . substitute(join(v:val, "="), "[&|<>^]", "^^^&", "g") . "& "'), '')
|
return join(map(env, '"set " . substitute(join(v:val, "="), "[&|<>^]", "^^^&", "g") . "& "'), '')
|
||||||
else
|
else
|
||||||
return 'env ' . s:shellesc(map(env, 'join(v:val, "=")')) . ' '
|
return '/usr/bin/env ' . s:shellesc(map(env, 'join(v:val, "=")')) . ' '
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ function! s:JobOpts(cmd, env) abort
|
|||||||
endif
|
endif
|
||||||
let envlist = map(items(a:env), 'join(v:val, "=")')
|
let envlist = map(items(a:env), 'join(v:val, "=")')
|
||||||
if !has('win32')
|
if !has('win32')
|
||||||
return [['env'] + envlist + a:cmd, {}]
|
return [['/usr/bin/env'] + envlist + a:cmd, {}]
|
||||||
else
|
else
|
||||||
let pre = join(map(envlist, '"set " . substitute(v:val, "[&|<>^]", "^^^&", "g") . "& "'), '')
|
let pre = join(map(envlist, '"set " . substitute(v:val, "[&|<>^]", "^^^&", "g") . "& "'), '')
|
||||||
if len(a:cmd) == 3 && a:cmd[0] ==# 'cmd.exe' && a:cmd[1] ==# '/c'
|
if len(a:cmd) == 3 && a:cmd[0] ==# 'cmd.exe' && a:cmd[1] ==# '/c'
|
||||||
|
|||||||
Reference in New Issue
Block a user