mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-10 07:13:00 -07: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:
parent
d6803ffa24
commit
807d899f3b
1 changed files with 1 additions and 1 deletions
|
@ -623,7 +623,7 @@ getOffsetReferences mods = fromMaybe [] $ do
|
||||||
offsets <- match !!! 0
|
offsets <- match !!! 0
|
||||||
return $ matchAllStrings variableNameRegex offsets
|
return $ matchAllStrings variableNameRegex offsets
|
||||||
where
|
where
|
||||||
re = mkRegex "^ *:(.*)"
|
re = mkRegex "^ *:([^-=?+].*)"
|
||||||
|
|
||||||
getReferencedVariables parents t =
|
getReferencedVariables parents t =
|
||||||
case t of
|
case t of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue