{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/28940","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/28940/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/28940/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/28940/events","html_url":"https://github.com/rust-lang/rust/issues/28940","id":110758549,"number":28940,"title":"`env::home_dir()` should use `SHGetKnownFolderPath()` on windows.","user":{"login":"Diggsey","id":451321,"avatar_url":"https://avatars.githubusercontent.com/u/451321?v=3","gravatar_id":"","url":"https://api.github.com/users/Diggsey","html_url":"https://github.com/Diggsey","followers_url":"https://api.github.com/users/Diggsey/followers","following_url":"https://api.github.com/users/Diggsey/following{/other_user}","gists_url":"https://api.github.com/users/Diggsey/gists{/gist_id}","starred_url":"https://api.github.com/users/Diggsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diggsey/subscriptions","organizations_url":"https://api.github.com/users/Diggsey/orgs","repos_url":"https://api.github.com/users/Diggsey/repos","events_url":"https://api.github.com/users/Diggsey/events{/privacy}","received_events_url":"https://api.github.com/users/Diggsey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-10T01:06:46Z","updated_at":"2015-10-10T15:03:21Z","closed_at":null,"body":"At the moment, it first looks at `%HOME%`, and then at `%USERPROFILE%`. This is bad for two reasons:\r\n\r\n1) The home directory will be different when run from an msys or cygwin terminal. Unless the program is specifically compiled to run in an msys/cygwin environment (they have their own target triples) then it should not be affected by `%HOME%` (only `%USERPROFILE%` stores the home directory on windows).\r\n\r\n2) Environment variables may be overridden. `SHGetKnownFolderPath()` will always give the correct path to the user's home folder."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/147096096","html_url":"https://github.com/rust-lang/rust/issues/28940#issuecomment-147096096","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/28940","id":147096096,"user":{"login":"FaultyRAM","id":316014,"avatar_url":"https://avatars.githubusercontent.com/u/316014?v=3","gravatar_id":"","url":"https://api.github.com/users/FaultyRAM","html_url":"https://github.com/FaultyRAM","followers_url":"https://api.github.com/users/FaultyRAM/followers","following_url":"https://api.github.com/users/FaultyRAM/following{/other_user}","gists_url":"https://api.github.com/users/FaultyRAM/gists{/gist_id}","starred_url":"https://api.github.com/users/FaultyRAM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FaultyRAM/subscriptions","organizations_url":"https://api.github.com/users/FaultyRAM/orgs","repos_url":"https://api.github.com/users/FaultyRAM/repos","events_url":"https://api.github.com/users/FaultyRAM/events{/privacy}","received_events_url":"https://api.github.com/users/FaultyRAM/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T15:03:21Z","updated_at":"2015-10-10T15:03:21Z","body":"Adding to this, `env::temp_dir()` also parses environment variables where `SHGetKnownFolderPath()` would be more appropriate."}}