diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index 617c3e945b..b3e191bbfc 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -48,8 +48,11 @@ myUserGecos = myVal [] userGecos #endif myVal :: [String] -> (UserEntry -> String) -> IO String -myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars +myVal envvars extract = go envvars where - check [] = return Nothing - check (v:vs) = maybe (check vs) (return . Just) =<< getEnv v - getpwent = getUserEntryForID =<< getEffectiveUserID +#ifndef mingw32_HOST_OS + go [] = extract <$> (getUserEntryForID =<< getEffectiveUserID) +#else + go [] = error $ "environment not set: " ++ show envvars +#endif + go (v:vs) = maybe (go vs) return =<< getEnv v diff --git a/doc/bugs/annex_get_fails_from_read-only_filesystem/comment_6_c469f1fe8ae6981a038be7f8723a07b1._comment b/doc/bugs/annex_get_fails_from_read-only_filesystem/comment_6_c469f1fe8ae6981a038be7f8723a07b1._comment new file mode 100644 index 0000000000..fac28c24d0 --- /dev/null +++ b/doc/bugs/annex_get_fails_from_read-only_filesystem/comment_6_c469f1fe8ae6981a038be7f8723a07b1._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 6""" + date="2014-10-31T16:55:47Z" + content=""" +An upgrade could move the annexed objects around. +"""]]