From: Jordan Rhee Date: Wed, 17 Oct 2018 16:41:09 +0000 (-0700) Subject: os: change UserHomeDir to use USERPROFILE on windows X-Git-Tag: go1.12beta1~741 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5ddec2488862899a31688025004bfffa5f7b242b;p=gostls13.git os: change UserHomeDir to use USERPROFILE on windows Fixes #28182 Change-Id: I49c2117fba6325c234512f937ff2edfa9477f52f Reviewed-on: https://go-review.googlesource.com/c/142886 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/os/file.go b/src/os/file.go index 3e626a023a..d9c5c57c17 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -384,12 +384,12 @@ func UserCacheDir() (string, error) { // UserHomeDir returns the current user's home directory. // // On Unix, including macOS, it returns the $HOME environment variable. -// On Windows, it returns the concatenation of %HOMEDRIVE% and %HOMEPATH%. +// On Windows, it returns %USERPROFILE%. // On Plan 9, it returns the $home environment variable. func UserHomeDir() string { switch runtime.GOOS { case "windows": - return Getenv("HOMEDRIVE") + Getenv("HOMEPATH") + return Getenv("USERPROFILE") case "plan9": return Getenv("home") case "nacl", "android":