mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 01:11:38 +08:00
Fix incorrect detection of bash-style substring expansion
Substring expansion detection only considers ':' as a separator.. It
needs to avoid triggering for ":-", ":=", ":+" and ":?", since they
mean other things.
This is a regression introduced by commit
a90b6d14b3
Signed-off-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
@@ -623,7 +623,7 @@ getOffsetReferences mods = fromMaybe [] $ do
|
||||
offsets <- match !!! 0
|
||||
return $ matchAllStrings variableNameRegex offsets
|
||||
where
|
||||
re = mkRegex "^ *:(.*)"
|
||||
re = mkRegex "^ *:([^-=?+].*)"
|
||||
|
||||
getReferencedVariables parents t =
|
||||
case t of
|
||||
|
Reference in New Issue
Block a user