mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-28 16:31:41 +08:00
Fixed quoted ~ warning to only trigger for ~/
This commit is contained in:
@@ -1852,7 +1852,7 @@ prop_checkTildeInQuotes5 = verifyNot checkTildeInQuotes "echo '/~foo/cow'"
|
|||||||
prop_checkTildeInQuotes6 = verifyNot checkTildeInQuotes "awk '$0 ~ /foo/'"
|
prop_checkTildeInQuotes6 = verifyNot checkTildeInQuotes "awk '$0 ~ /foo/'"
|
||||||
checkTildeInQuotes _ = check
|
checkTildeInQuotes _ = check
|
||||||
where
|
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 ()
|
verify _ _ = return ()
|
||||||
check (T_NormalWord _ (T_SingleQuoted id str:_)) =
|
check (T_NormalWord _ (T_SingleQuoted id str:_)) =
|
||||||
verify id str
|
verify id str
|
||||||
|
@@ -950,7 +950,7 @@ readNormalEscaped = called "escaped char" $ do
|
|||||||
pos <- getPosition
|
pos <- getPosition
|
||||||
backslash
|
backslash
|
||||||
do
|
do
|
||||||
next <- quotable <|> oneOf "?*@!+[]{}.,"
|
next <- quotable <|> oneOf "?*@!+[]{}.,~"
|
||||||
return $ if next == '\n' then "" else [next]
|
return $ if next == '\n' then "" else [next]
|
||||||
<|>
|
<|>
|
||||||
do
|
do
|
||||||
|
Reference in New Issue
Block a user