Windows: Fix crash when user.name is not set in git config.
This commit is contained in:
parent
8c622ec100
commit
0f6aaf8012
5 changed files with 18 additions and 22 deletions
|
@ -40,11 +40,12 @@ myUserName = myVal env userName
|
|||
env = ["USERNAME", "USER", "LOGNAME"]
|
||||
#endif
|
||||
|
||||
myUserGecos :: IO String
|
||||
#ifdef __ANDROID__
|
||||
myUserGecos = return "" -- userGecos crashes on Android
|
||||
myUserGecos :: IO (Maybe String)
|
||||
-- userGecos crashes on Android and is not available on Windows.
|
||||
#if defined(__ANDROID__) || defined(mingw32_HOST_OS)
|
||||
myUserGecos = return Nothing
|
||||
#else
|
||||
myUserGecos = myVal [] userGecos
|
||||
myUserGecos = Just <$> myVal [] userGecos
|
||||
#endif
|
||||
|
||||
myVal :: [String] -> (UserEntry -> String) -> IO String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue