mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Remove unnecessary uses of head
This commit is contained in:
parent
c95914f9b3
commit
6d06103cab
5 changed files with 14 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue