-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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: Always double-quote path when launching explorer.exe to browse #78963
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested this myself on Windows 11 Pro
|
akien-mga
approved these changes
Aug 17, 2023
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.
Looks like 3 straightforward typo fixes.
akien-mga
reviewed
Aug 17, 2023
akien-mga
reviewed
Aug 17, 2023
akien-mga
added
the
cherrypick:4.1
Considered for cherry-picking into a future 4.1.x release
label
Aug 17, 2023
Code now always double quotes the filename to use as command line argument when calling explorer.exe. In particular, commas in a filename would be interpreted by explorer.exe as separators for commands. Similarly a trim_suffix for "file://" is assumed to be a mistake, this could potentially be a PREfix that we want to strip, but never a suffix. Since it didn't seem needed in the end, we removed it.
akien-mga
force-pushed
the
comma_in_filename
branch
from
August 28, 2023 10:47
135600e
to
5608b1d
Compare
akien-mga
changed the title
Always double-quote file or folder name when launching explorer.exe to browse
Windows: Always double-quote path when launching explorer.exe to browse
Aug 28, 2023
I pushed my suggested changes, but didn't test (I'm on Linux). CC @bruvzg |
bruvzg
approved these changes
Aug 28, 2023
Thanks! |
YuriSizov
removed
the
cherrypick:4.1
Considered for cherry-picking into a future 4.1.x release
label
Oct 24, 2023
Cherry-picked for 4.1.3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #78949
Code now always double quotes the filename to use as command line argument when calling 'explorer.exe'. In particular, commas in a filename would be interpreted by 'explorer.exe' as separators for commands.
Fixed the logic logic where existing leading or trailing double quotes in the filename were duplicated, instead of adding them when they were missing.
Similarly a
trim_suffix
for "file://" is assumed to be a mistake, this could potentially be a _pre_fix that we want to strip, but never a suffix.Judging from the commit that first introduced the
OS_Windows::shell_show_in_file_manager
function I would guess that stripping "file://" was some intermediate decision that might not be needed in the end, and never even worked. The old code would prefix "file://" at several locations, but this was all moved to the base implementation of shell_show_in_file_manager, and the new windows implementation never prefixes, so there is no need for trimming.Maybe trimming the prefix could be dropped altogether, but I'm playing safe. I do not know if there are usages of this method that I am unaware of. If this method is exposed to GDScript or plugins use it, that code could still be prefixing "file://", hence we need to strip it for the windows version.