From 9ac9536f1468d063731e01f522d570c5b91c1080 Mon Sep 17 00:00:00 2001 From: "Valery V. Vorotyntsev" Date: Thu, 12 Mar 2009 10:13:14 +0100 Subject: Prompt.Shell: escape ampersand Ignore-this: 7200b76af8109bab794157da46cb0030 Ampersand (&) is a special character and should be escaped. darcs-hash:20090312091314-752c4-e16dcbdf05ea59db8b2e02d3157cd98ac2734d9b.gz --- XMonad/Prompt/Shell.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XMonad/Prompt/Shell.hs b/XMonad/Prompt/Shell.hs index d1ea150..4dc466a 100644 --- a/XMonad/Prompt/Shell.hs +++ b/XMonad/Prompt/Shell.hs @@ -118,13 +118,12 @@ split e l = escape :: String -> String escape [] = "" -escape (' ':xs) = "\\ " ++ escape xs escape (x:xs) | isSpecialChar x = '\\' : x : escape xs | otherwise = x : escape xs isSpecialChar :: Char -> Bool -isSpecialChar = flip elem "\\@\"'#?$*()[]{};" +isSpecialChar = flip elem " &\\@\"'#?$*()[]{};" -- | Ask the shell environment for env :: String -> String -> IO String -- cgit v1.2.3