Skip to content

fix(paths): restrict backslash-to-slash normalization to win32 - #157

Open
Zaldaryon wants to merge 1 commit into
devfrom
fix/posix-backslash-normalization
Open

fix(paths): restrict backslash-to-slash normalization to win32#157
Zaldaryon wants to merge 1 commit into
devfrom
fix/posix-backslash-normalization

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

On posix, backslash is a legal filename character. The unconditional replacement in normalizeFolderForComparison collapsed dir\x and dir/x into the same normalized string, producing false in-use refusals when both paths existed on a Linux filesystem.

This moves the backslash-to-slash replacement inside the win32 branch. Posix paths now preserve backslash as a literal character, and the trailing-separator strip still handles both separators on both platforms.

Test updated to assert the new posix behavior.

Fixes #155

On posix, backslash is a legal filename character. The unconditional
replacement collapsed dir\x and dir/x into the same normalized string,
producing false in-use refusals when both existed.

Move the backslash-to-slash replacement inside the win32 branch so posix
paths preserve backslash as a literal character.

Fixes #155

@Pixnop Pixnop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Probed both directions on the head: the posix pair with a literal backslash in the name now stays distinct, and the win32 mixed-separator detection is preserved. Sixteen tests pass with the updated posix row. That closes the last quirk from the paths module cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants