diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-11-14 14:14:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-11-14 14:14:10 -0400 |
commit | bb5178557d8563608be7e9e04a4916fd2048d176 (patch) | |
tree | 0013232fca756f278dd44fefc45a18a1a9d35289 /Utility/UserInfo.hs | |
parent | b9d5a5fd5e9631840857878935c3727217f12b9a (diff) |
clean up build warnings on Windows
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 dd66c331e..d504fa5c3 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 |