Don't warn about &&+|| when used with return

This commit is contained in:
Vidar Holen 2014-05-09 18:08:55 -07:00
parent f9aeabc245
commit deab146fab
1 changed files with 1 additions and 1 deletions

View File

@ -814,7 +814,7 @@ checkShorthandIf _ (T_AndIf id _ (T_OrIf _ _ (T_Pipeline _ _ t)))
where where
isOk [t] = isAssignment t || (fromMaybe False $ do isOk [t] = isAssignment t || (fromMaybe False $ do
name <- getCommandBasename t name <- getCommandBasename t
return $ name `elem` ["echo", "exit"]) return $ name `elem` ["echo", "exit", "return"])
isOk _ = False isOk _ = False
checkShorthandIf _ _ = return () checkShorthandIf _ _ = return ()