Fix AbsolutePath returning non identical strings on semantically identical paths - #17355
Open
DeltachangeOG wants to merge 3 commits into
Open
Fix AbsolutePath returning non identical strings on semantically identical paths#17355DeltachangeOG wants to merge 3 commits into
DeltachangeOG wants to merge 3 commits into
Conversation
ZenonSeth
reviewed
Jul 18, 2026
sfan5
reviewed
Jul 18, 2026
DeltachangeOG
force-pushed
the
fix-unit-test-and-errors
branch
from
July 18, 2026 11:06
5f08cfb to
ac9ef23
Compare
DeltachangeOG
force-pushed
the
fix-unit-test-and-errors
branch
from
July 18, 2026 11:21
ac9ef23 to
dfb011a
Compare
sfan5
reviewed
Jul 18, 2026
Desour
reviewed
Jul 26, 2026
Co-authored-by: DS <7613443+Desour@users.noreply.github.com>
Desour
reviewed
Jul 30, 2026
| UASSERTCMP(auto, !=, fs::AbsolutePath(dir_path2), ""); // now it does | ||
| const auto absolute_dir_path = fs::AbsolutePath(dir_path2); | ||
| UASSERTCMP(auto, !=, absolute_dir_path, "");// now it does | ||
| const std::filesystem::path absolute_path(absolute_dir_path); |
Member
There was a problem hiding this comment.
Also needs native_format.
You might want to add a fs::getRootPathOf(path).
This file contains hidden or 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
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.
Add compact, short information about your PR for easier understanding:
AbsolutePath should return identical strings for semantically identical strings but previously could return: C:/Test/Path and C:/Test/Path/ depending on what the function was called on. This lead to failing tests because other functions expected identical outputs. The invalid string position would wrongfully assume that one path had a delimiter and then move to the other side of the delimiter to attempt comparison but since they were the same path it was an out of bounds index.
Part of #17354
To do
This PR is Ready for Review.
I added unit tests that ensure AbsolutePath returns as expected. I also tested master branch for non ASCII character handling(it doesn't) to ensure my fix didn't break previous functionality