diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-12-14 12:55:53 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-12-14 12:55:53 -0400 |
commit | 5ca81d114d7ccf0ee984cb03f56ad6ec1d9499f0 (patch) | |
tree | 4b49c7c03e77f356dd3941070509a498d97a3290 /Utility/UserInfo.hs | |
parent | 3a59749f2c0603872109a85c44234dd744d059cc (diff) | |
download | git-repair-5ca81d114d7ccf0ee984cb03f56ad6ec1d9499f0.tar.gz |
Merge from git-annex.
Diffstat (limited to 'Utility/UserInfo.hs')
-rw-r--r-- | Utility/UserInfo.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index dd66c33..d504fa5 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -15,11 +15,13 @@ module Utility.UserInfo ( ) where import Utility.Env -import Utility.Data import Utility.Exception +#ifndef mingw32_HOST_OS +import Utility.Data +import Control.Applicative +#endif import System.PosixCompat -import Control.Applicative import Prelude {- Current user's home directory. @@ -58,6 +60,7 @@ myVal envvars extract = go envvars #ifndef mingw32_HOST_OS go [] = Right . extract <$> (getUserEntryForID =<< getEffectiveUserID) #else - go [] = return $ Left ("environment not set: " ++ show envvars) + go [] = return $ either Left (Right . extract) $ + Left ("environment not set: " ++ show envvars) #endif go (v:vs) = maybe (go vs) (return . Right) =<< getEnv v |