aboutsummaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-15 16:04:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-15 16:04:08 -0400
commiteb132a854ec9098acbc2a3caac5fd09947879268 (patch)
tree580921f416ca621a71dc214048e53217ab0a8405 /Git/Config.hs
parent111b6937ec1110feed024deee6fa95cdb78b9c95 (diff)
avoid partial head function
(although it was used safely)
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index 8d7963994..7b72eba5a 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -5,14 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module Git.Config (
- get,
- read,
- hRead,
- store
-) where
+module Git.Config where
-import Prelude hiding (read)
import System.Posix.Directory
import Control.Exception (bracket_)
import qualified Data.Map as M
@@ -58,7 +52,7 @@ parse :: String -> M.Map String String
parse [] = M.empty
parse s
-- --list output will have an = in the first line
- | '=' `elem` head ls = sep '=' ls
+ | all ('=' `elem`) (take 1 ls) = sep '=' ls
-- --null --list output separates keys from values with newlines
| otherwise = sep '\n' $ split "\0" s
where