From d8b5d6393a6b1f41895e1f11207fc5a91a8122ca Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 12 Nov 2013 18:27:18 -0800 Subject: [PATCH] \" should not be treated specially in `backticks` --- ShellCheck/Parser.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 36edf3a..6d013a5 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -701,6 +701,7 @@ readSingleQuotedPart = <|> anyChar `reluctantlyTill1` (singleQuote <|> backslash) prop_readBackTicked = isOk readBackTicked "`ls *.mp3`" +prop_readBackTicked2 = isOk readBackTicked "`grep \"\\\"\"`" readBackTicked = called "backtick expansion" $ do id <- getNextId pos <- getPosition @@ -713,7 +714,7 @@ readBackTicked = called "backtick expansion" $ do return $ T_Backticked id result where unEscape [] = [] - unEscape ('\\':x:rest) | x `elem` "\"$`\\" = x : unEscape rest + unEscape ('\\':x:rest) | x `elem` "$`\\" = x : unEscape rest unEscape ('\\':'\n':rest) = unEscape rest unEscape (c:rest) = c : unEscape rest