From f7ed989081e98df4eceaf21bc23197abeba332ef Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Sun, 19 May 2013 23:42:08 +0200 Subject: Bug fix: Make xolox#misc#os#exec() compatible with (t)csh (reported by Armin Widegreen) Original report: https://github.com/xolox/vim-easytags/pull/48 --- autoload/xolox/misc/compat.vim | 4 ++-- autoload/xolox/misc/os.vim | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'autoload') diff --git a/autoload/xolox/misc/compat.vim b/autoload/xolox/misc/compat.vim index 70a4287..c950ad6 100644 --- a/autoload/xolox/misc/compat.vim +++ b/autoload/xolox/misc/compat.vim @@ -1,13 +1,13 @@ " Vim auto-load script " Author: Peter Odding -" Last Change: May 13, 2013 +" Last Change: May 19, 2013 " URL: http://peterodding.com/code/vim/misc/ " The following integer will be bumped whenever a change in the miscellaneous " scripts breaks backwards compatibility. This enables my Vim plug-ins to fail " early when they detect an incompatible version, instead of breaking at the " worst possible moments :-). -let g:xolox#misc#compat#version = 3 +let g:xolox#misc#compat#version = 4 " Remember the directory where the miscellaneous scripts are loaded from " so the user knows which plug-in to update if incompatibilities arise. diff --git a/autoload/xolox/misc/os.vim b/autoload/xolox/misc/os.vim index ef036df..8add797 100644 --- a/autoload/xolox/misc/os.vim +++ b/autoload/xolox/misc/os.vim @@ -1,9 +1,9 @@ " Vim auto-load script " Author: Peter Odding -" Last Change: May 13, 2013 +" Last Change: May 19, 2013 " URL: http://peterodding.com/code/vim/misc/ -let g:xolox#misc#os#version = '0.2' +let g:xolox#misc#os#version = '0.3' function! xolox#misc#os#is_win() " {{{1 " Check whether Vim is running on Microsoft Windows. @@ -72,6 +72,14 @@ function! xolox#misc#os#exec(options) " {{{1 endif endif + " Execute the command line using 'sh' instead of the default shell, + " because we assume that standard output and standard error can be + " redirected separately, but (t)csh does not support this. + if has('unix') + call xolox#misc#msg#debug("os.vim %s: Generated shell expression: %s", g:xolox#misc#os#version, cmd) + let cmd = printf('sh -c %s', xolox#misc#escape#shell(cmd)) + endif + " Let the user know what's happening (in case they're interested). call xolox#misc#msg#debug("os.vim %s: Executing external command using system() function: %s", g:xolox#misc#os#version, cmd) call system(cmd) -- cgit v1.2.3