mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-09 15:38:49 +08:00
Remove unnecessary uses of head
This commit is contained in:
@@ -2293,7 +2293,7 @@ checkWhileReadPitfalls _ (T_WhileExpression id [command] contents)
|
||||
|
||||
isStdinReadCommand (T_Pipeline _ _ [T_Redirecting id redirs cmd]) =
|
||||
let plaintext = oversimplify cmd
|
||||
in head (plaintext ++ [""]) == "read"
|
||||
in headOrDefault "" plaintext == "read"
|
||||
&& ("-u" `notElem` plaintext)
|
||||
&& all (not . stdinRedirect) redirs
|
||||
isStdinReadCommand _ = False
|
||||
|
Reference in New Issue
Block a user