From 807d899f3b6139a61b644420d3f74b21bb0fb272 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 20 Jul 2017 09:20:37 +1000 Subject: [PATCH] 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 a90b6d14b3de0f21db462afbc925444687feb2ca Signed-off-by: Martin Schwenke --- ShellCheck/AnalyzerLib.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellCheck/AnalyzerLib.hs b/ShellCheck/AnalyzerLib.hs index a119d9b..bb8df63 100644 --- a/ShellCheck/AnalyzerLib.hs +++ b/ShellCheck/AnalyzerLib.hs @@ -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