mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-13 08:33:20 -07:00
Disable UUOC for cat with unquoted variable (fixes #2333)
This commit is contained in:
parent
3a296cd788
commit
ad92cb4112
2 changed files with 10 additions and 9 deletions
|
@ -287,14 +287,14 @@ isArrayExpansion (T_DollarBraced _ _ l) =
|
|||
isArrayExpansion _ = False
|
||||
|
||||
-- Is it possible that this arg becomes multiple args?
|
||||
mayBecomeMultipleArgs t = willBecomeMultipleArgs t || f t
|
||||
mayBecomeMultipleArgs t = willBecomeMultipleArgs t || f False t
|
||||
where
|
||||
f (T_DollarBraced _ _ l) =
|
||||
f quoted (T_DollarBraced _ _ l) =
|
||||
let string = concat $ oversimplify l in
|
||||
"!" `isPrefixOf` string
|
||||
f (T_DoubleQuoted _ parts) = any f parts
|
||||
f (T_NormalWord _ parts) = any f parts
|
||||
f _ = False
|
||||
not quoted || "!" `isPrefixOf` string
|
||||
f quoted (T_DoubleQuoted _ parts) = any (f True) parts
|
||||
f quoted (T_NormalWord _ parts) = any (f quoted) parts
|
||||
f _ _ = False
|
||||
|
||||
-- Is it certain that this word will becomes multiple words?
|
||||
willBecomeMultipleArgs t = willConcatInAssignment t || f t
|
||||
|
@ -302,7 +302,6 @@ willBecomeMultipleArgs t = willConcatInAssignment t || f t
|
|||
f T_Extglob {} = True
|
||||
f T_Glob {} = True
|
||||
f T_BraceExpansion {} = True
|
||||
f (T_DoubleQuoted _ parts) = any f parts
|
||||
f (T_NormalWord _ parts) = any f parts
|
||||
f _ = False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue