From 32de288c35b5cc728821c1c465c398f9bd8ba8d5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 May 2012 19:51:41 -0400 Subject: syntax tweaks Although I hate to lose one of the only places I've ever used the list monad.. --- Logs/Remote.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Logs') diff --git a/Logs/Remote.hs b/Logs/Remote.hs index 5c9d67df0..b75573a41 100644 --- a/Logs/Remote.hs +++ b/Logs/Remote.hs @@ -36,7 +36,7 @@ configSet u c = do {- Map of remotes by uuid containing key/value config maps. -} readRemoteLog :: Annex (M.Map UUID RemoteConfig) -readRemoteLog = (simpleMap . parseLog parseConfig) <$> Annex.Branch.get remoteLog +readRemoteLog = simpleMap . parseLog parseConfig <$> Annex.Branch.get remoteLog parseConfig :: String -> Maybe RemoteConfig parseConfig = Just . keyValToConfig . words @@ -59,7 +59,7 @@ configToKeyVal m = map toword $ sort $ M.toList m toword (k, v) = k ++ "=" ++ configEscape v configEscape :: String -> String -configEscape = (>>= escape) +configEscape = concatMap escape where escape c | isSpace c || c `elem` "&" = "&" ++ show (ord c) ++ ";" -- cgit v1.2.3