From c4175188198be5a52104482554cda0b85562dc99 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 27 Jul 2021 15:23:10 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 4c3de67..c2aa0cc 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -251,7 +251,7 @@ function! s:GitCmd() abort let string = g:fugitive_git_executable let list = [] if string =~# '^\w\+=' - call add(list, 'env') + call add(list, '/usr/bin/env') endif while string =~# '\S' let arg = matchstr(string, '^\s*\%(' . dquote . '''[^'']*''\|\\.\|[^[:space:] |]\)\+') @@ -479,7 +479,7 @@ function! s:BuildEnvPrefix(env) abort elseif s:winshell() return join(map(env, '"set " . substitute(join(v:val, "="), "[&|<>^]", "^^^&", "g") . "& "'), '') else - return 'env ' . s:shellesc(map(env, 'join(v:val, "=")')) . ' ' + return '/usr/bin/env ' . s:shellesc(map(env, 'join(v:val, "=")')) . ' ' endif endfunction @@ -491,7 +491,7 @@ function! s:JobOpts(cmd, env) abort endif let envlist = map(items(a:env), 'join(v:val, "=")') if !has('win32') - return [['env'] + envlist + a:cmd, {}] + return [['/usr/bin/env'] + envlist + a:cmd, {}] else let pre = join(map(envlist, '"set " . substitute(v:val, "[&|<>^]", "^^^&", "g") . "& "'), '') if len(a:cmd) == 3 && a:cmd[0] ==# 'cmd.exe' && a:cmd[1] ==# '/c'