summaryrefslogtreecommitdiff
path: root/Logs/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-16 01:59:07 -0400
commit184a69171d5d983ee2f08cce28011d235f44cc5c (patch)
treeff85fc620618b55c8cbed0d8c99212e73004f5b5 /Logs/Remote.hs
parentc0c9991c9f5322aef05f4c97d2c3f3bdc3101e46 (diff)
removed another 10 lines via ifM
Diffstat (limited to 'Logs/Remote.hs')
-rw-r--r--Logs/Remote.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Logs/Remote.hs b/Logs/Remote.hs
index ccfb4bb31..5c9d67df0 100644
--- a/Logs/Remote.hs
+++ b/Logs/Remote.hs
@@ -72,14 +72,15 @@ configUnEscape = unescape
unescape (c:rest)
| c == '&' = entity rest
| otherwise = c : unescape rest
- entity s = if ok
- then chr (Prelude.read num) : unescape rest
- else '&' : unescape s
+ entity s
+ | not (null num) && ";" `isPrefixOf` r =
+ chr (Prelude.read num) : unescape rest
+ | otherwise =
+ '&' : unescape s
where
num = takeWhile isNumber s
r = drop (length num) s
rest = drop 1 r
- ok = not (null num) && ";" `isPrefixOf` r
{- for quickcheck -}
prop_idempotent_configEscape :: String -> Bool