From 01a5d40d08ccecf3515c809d9f1496e669ccd75b Mon Sep 17 00:00:00 2001 From: mirza-s Date: Wed, 3 Oct 2018 22:25:52 +0200 Subject: [PATCH] preserve shellcmdflag and normalize for /bin/sh as it may contain flags not understood by /bin/sh --- autoload/go/util.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/go/util.vim b/autoload/go/util.vim index 249c7b69fa..50b33d95db 100644 --- a/autoload/go/util.vim +++ b/autoload/go/util.vim @@ -137,12 +137,13 @@ endfunction " so that we always use a standard POSIX-compatible Bourne shell (and not e.g. " csh, fish, etc.) See #988 and #1276. function! s:system(cmd, ...) abort - " Preserve original shell and shellredir values + " Preserve original shell, shellredir and shellcmdflag values let l:shell = &shell let l:shellredir = &shellredir + let l:shellcmdflag = &shellcmdflag if !go#util#IsWin() && executable('/bin/sh') - set shell=/bin/sh shellredir=>%s\ 2>&1 + set shell=/bin/sh shellredir=>%s\ 2>&1 shellcmdflag=-c endif try @@ -151,6 +152,7 @@ function! s:system(cmd, ...) abort " Restore original values let &shell = l:shell let &shellredir = l:shellredir + let &shellcmdflag = l:shellcmdflag endtry endfunction