summaryrefslogtreecommitdiff
path: root/Utility/UserInfo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/UserInfo.hs')
-rw-r--r--Utility/UserInfo.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs
index 8fba3e17f..00790f615 100644
--- a/Utility/UserInfo.hs
+++ b/Utility/UserInfo.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.UserInfo (
myHomeDir,
myUserName,
@@ -26,7 +28,11 @@ myUserName :: IO String
myUserName = myVal ["USER", "LOGNAME"] userName
myUserGecos :: IO String
+#ifdef WITH_ANDROID
+myUserGecos = return "" -- userGecos crashes on Android
+#else
myUserGecos = myVal [] userGecos
+#endif
myVal :: [String] -> (UserEntry -> String) -> IO String
myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars