recognize '#!/bin/sh' as well

This commit is contained in:
kongo2002 2009-12-29 22:03:54 +08:00 committed by Martin Grenfell
parent 6788c8513a
commit 7d6452a15f

View File

@ -21,6 +21,8 @@ function! GetShell()
return 'bash' return 'bash'
elseif match(shebang, 'zsh') >= 0 elseif match(shebang, 'zsh') >= 0
return 'zsh' return 'zsh'
elseif match(shebang, 'sh') >= 0
return 'sh'
endif endif
endif endif
return '' return ''
@ -30,7 +32,7 @@ function! SyntaxCheckers_sh_GetLocList()
if !exists('b:shell') if !exists('b:shell')
let b:shell = GetShell() let b:shell = GetShell()
endif endif
if len(b:shell) == 0 if len(b:shell) == 0 || !executable(b:shell)
return [] return []
endif endif
let output = split(system(b:shell.' -n '.shellescape(expand('%'))), '\n') let output = split(system(b:shell.' -n '.shellescape(expand('%'))), '\n')