-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
env::home_dir() should use SHGetKnownFolderPath() on windows. #28940
Copy link
Copy link
Closed
Labels
C-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.O-windowsOperating system: WindowsOperating system: WindowsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.O-windowsOperating system: WindowsOperating system: WindowsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
At the moment, it first looks at
%HOME%, and then at%USERPROFILE%. This is bad for two reasons: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).Environment variables may be overridden.
SHGetKnownFolderPath()will always give the correct path to the user's home folder.