mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-18 17:56:55 +08:00
\" should not be treated specially in backticks
This commit is contained in:
@@ -701,6 +701,7 @@ readSingleQuotedPart =
|
|||||||
<|> anyChar `reluctantlyTill1` (singleQuote <|> backslash)
|
<|> anyChar `reluctantlyTill1` (singleQuote <|> backslash)
|
||||||
|
|
||||||
prop_readBackTicked = isOk readBackTicked "`ls *.mp3`"
|
prop_readBackTicked = isOk readBackTicked "`ls *.mp3`"
|
||||||
|
prop_readBackTicked2 = isOk readBackTicked "`grep \"\\\"\"`"
|
||||||
readBackTicked = called "backtick expansion" $ do
|
readBackTicked = called "backtick expansion" $ do
|
||||||
id <- getNextId
|
id <- getNextId
|
||||||
pos <- getPosition
|
pos <- getPosition
|
||||||
@@ -713,7 +714,7 @@ readBackTicked = called "backtick expansion" $ do
|
|||||||
return $ T_Backticked id result
|
return $ T_Backticked id result
|
||||||
where
|
where
|
||||||
unEscape [] = []
|
unEscape [] = []
|
||||||
unEscape ('\\':x:rest) | x `elem` "\"$`\\" = x : unEscape rest
|
unEscape ('\\':x:rest) | x `elem` "$`\\" = x : unEscape rest
|
||||||
unEscape ('\\':'\n':rest) = unEscape rest
|
unEscape ('\\':'\n':rest) = unEscape rest
|
||||||
unEscape (c:rest) = c : unEscape rest
|
unEscape (c:rest) = c : unEscape rest
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user