From 0a2cf208c86c2cb06ec0ac79be6ccc12ce308e87 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 7 Mar 2015 23:48:01 -0800 Subject: [PATCH] Fixed quoted ~ warning to only trigger for ~/ --- ShellCheck/Analytics.hs | 2 +- ShellCheck/Parser.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index 2b779d2..4923e70 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -1852,7 +1852,7 @@ prop_checkTildeInQuotes5 = verifyNot checkTildeInQuotes "echo '/~foo/cow'" prop_checkTildeInQuotes6 = verifyNot checkTildeInQuotes "awk '$0 ~ /foo/'" checkTildeInQuotes _ = check where - verify id ('~':_) = warn id 2088 "Note that ~ does not expand in quotes." + verify id ('~':'/':_) = warn id 2088 "Note that ~ does not expand in quotes." verify _ _ = return () check (T_NormalWord _ (T_SingleQuoted id str:_)) = verify id str diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 6c20738..d3cd670 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -950,7 +950,7 @@ readNormalEscaped = called "escaped char" $ do pos <- getPosition backslash do - next <- quotable <|> oneOf "?*@!+[]{}.," + next <- quotable <|> oneOf "?*@!+[]{}.,~" return $ if next == '\n' then "" else [next] <|> do