Improve handling of command prefixes like exec/command (fixes #2008)

This commit is contained in:
Vidar Holen 2020-07-25 13:45:05 -07:00
parent 5b86777f9d
commit 5d753212fb
4 changed files with 81 additions and 53 deletions

View file

@ -280,7 +280,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
flagRegex = mkRegex "^-[eEsn]+$"
bashism t@(T_SimpleCommand _ _ (cmd:arg:_))
| t `isCommand` "exec" && "-" `isPrefixOf` concat (oversimplify arg) =
| getLiteralString cmd == Just "exec" && "-" `isPrefixOf` concat (oversimplify arg) =
warnMsg (getId arg) "exec flags are"
bashism t@(T_SimpleCommand id _ _)
| t `isCommand` "let" = warnMsg id "'let' is"