From 8f40f27d59a8eaed11b346a2878a27047e41be54 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Fri, 2 Aug 2013 13:10:14 +0300 Subject: [PATCH] Fix shellpipe expansion. --- plugin/syntastic.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 8123877a..ba85075f 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -367,8 +367,15 @@ function! SyntasticMake(options) let $LC_ALL = 'C' - let err_file=tempname() - call system(a:options['makeprg'] . ' ' . shell_pipe . ' ' . syntastic#util#shescape(err_file)) + let err_file = tempname() + let err_file_escaped = &shellquote . syntastic#util#shescape(err_file) . &shellquote + let redirect = substitute(shell_pipe, '\m%\([%s]\)', '\=(submatch(1) == "%" ? "%%" : err_file_escaped)', 'g') + if redirect == shell_pipe + " no %s in &shellpipe + let redirect .= ' ' . err_file_escaped + endif + + call system(a:options['makeprg'] . ' ' . redirect) let err_lines = s:ReadFile(err_file) call delete(err_file)