health#provider: fix logic with s:shellify

It should be quoted if there is any character that needs escaping, but
not if there is a character that does not need escaping.
This commit is contained in:
Daniel Hahler 2018-04-30 16:48:32 +02:00
parent 4744142fad
commit 87d3f265bc

View File

@ -51,7 +51,7 @@ function! s:shellify(cmd) abort
return a:cmd
endif
return join(map(copy(a:cmd),
\'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
\'v:val =~# ''\m[^\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
endfunction
" Run a system command and timeout after 30 seconds.