New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Prefer USERPROFILE over HOMEPATH on startup as well #7033
base: master
Are you sure you want to change the base?
Conversation
} | ||
else if (get_special_folder(CSIDL_PERSONAL, env, numberof(env))) { | ||
f = TRUE; | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why separated only this else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former code was made so that if either HOMEDRIVE
or HOMEPATH
is defined alone, then it still is used without the other half. Maybe this a questionable behavior, but I wanted to keep that how it is.
Maybe the diff -w
output is more descriptive.
@larskanis FYI https://github.com/ruby/spec/actions/runs/3849235325/jobs/6557993944 failed, so I commented ruby/spec@c181abc, please rebase and uncomment it in this PR if it passes now |
Ah maybe that just needs a |
Yes, both specs are ruby-3.2 only for now. But the encoding fix is marked as to be backported to 3.1 and 3.0 in https://bugs.ruby-lang.org/issues/19243 . That's why I set the version guard to 3.0. Should fixes always be enabled on the latest ruby only at first? And later on extended when they are backported? |
3fe2118
to
bf71e25
Compare
In ruby/spec's at least yes. Because REQUIRED still depends on the branch maintainer decision, and latest ruby/spec is used by and must work on CRuby e.g. 3.1 3.0 etc branches (https://rubyci.org/). |
@eregon Makes sense. Thanks for clarification! I added the version guard and rebased the PR. |
This is a fix-up of commit d0f5dc9 .
Unfortunately the original intention to allow the use of ruby in a
runas
environment wasn't fixed by the above commit. This is because the win32 initialization sets theHOME
environment variable based on a separate evaluation ofUSERPROFILE
,HOMEDRIVE
andHOMEPATH
. And theHOME
variable is preferred byDir.home
. I'm sorry I didn't know about this initialization, so that I missed to adjust this code part properly. This is now fixed.Fixes https://bugs.ruby-lang.org/issues/19244