mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Avoid defining flags for non-literal parameters
This commit is contained in:
parent
561075ea79
commit
3e3e4fd0cd
2 changed files with 5 additions and 4 deletions
|
@ -685,10 +685,10 @@ getModifiedVariableCommand base@(T_SimpleCommand _ _ (T_NormalWord _ (T_Literal
|
|||
(filter (\(x,_) -> getLiteralString x == Just "-a") (zip (args) (tail args)))
|
||||
|
||||
-- get the FLAGS_ variable created by a shflags DEFINE_ call
|
||||
getFlagVariable (n:v:_) = return (base, n, flagName n, DataString $ SourceFrom [v])
|
||||
where
|
||||
flagName varName@(T_NormalWord _ _) = "FLAGS_" ++ (onlyLiteralString varName)
|
||||
getFlagVariable _ = fail "Invalid flag definition"
|
||||
getFlagVariable (n:v:_) = do
|
||||
name <- getLiteralString v
|
||||
return (base, n, "FLAGS_" ++ name, DataString $ SourceExternal)
|
||||
getFlagVariable _ = Nothing
|
||||
|
||||
getModifiedVariableCommand _ = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue