Fix parent directory creation for absolute POSIX paths#9777
Merged
LocalIdentity merged 1 commit intoPathOfBuildingCommunity:devfrom Apr 18, 2026
Merged
Fix parent directory creation for absolute POSIX paths#9777LocalIdentity merged 1 commit intoPathOfBuildingCommunity:devfrom
LocalIdentity merged 1 commit intoPathOfBuildingCommunity:devfrom
Conversation
The `[^/]+/` match pattern requires at least on non-slash character before the trailing slash. This works on Windows where absolute paths start with a drive letter. With absolute POSIX paths, the leading slash is skipped by this pattern causing the accumulated `dirStr` to not start with a slash. `dirStr` is then interpreted as a relative path, causing the directories to be erroneously created in the current working directory. This change fixes the erroneous behavior with absolute POSIX paths by initializing `dirStr` with a slash if the `fullPath` starts with a slash. It retains the current behavior on Windows systems.
Contributor
Author
|
Same change can be applied to be PoB2 repo. |
Contributor
Author
|
@stevschmid you might be interested in this since you had to apply the same patch to make the macOS port work. |
LocalIdentity
approved these changes
Apr 18, 2026
github-actions bot
pushed a commit
to PathOfBuildingCommunity/PathOfBuilding-PoE2
that referenced
this pull request
Apr 18, 2026
|
@meehl Thanks! Great change. |
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.
The
[^/]+/match pattern requires at least on non-slash character before the trailing slash. This works on Windows where absolute paths start with a drive letter.With absolute POSIX paths, the leading slash is skipped by this pattern causing the accumulated
dirStrto not start with a slash.dirStris then interpreted as a relative path, causing the directories to be erroneously created in the current working directory.This change fixes the erroneous behavior with absolute POSIX paths by initializing
dirStrwith a slash if thefullPathstarts with a slash. It retains the current behavior on Windows systems.