Skip to content
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

Fix NSURL path on Windows for UNC paths #308

Merged
merged 1 commit into from
Jul 26, 2023
Merged

Conversation

triplef
Copy link
Member

@triplef triplef commented Jul 26, 2023

Fixes issue on Windows where initializing NSURL with an UNC path like \\server\path\xxx\ and getting back its path adds an extra leading forward slash:

NSURL *url = [NSURL fileURLWithPath:@"\\\\path\\to\\test.txt"];
NSLog(@"url: %@", url); // => file:///%5C%5Cpath%5Cto%5Ctest.txt
NSLog(@"path: %@", url.path); // => /\\path\to\test.txt (extra forward slash)

@triplef triplef requested a review from rfm as a code owner July 26, 2023 13:16
@triplef triplef changed the title Fix NSURL path on Windows for network paths like \\xxx Fix NSURL path on Windows for UNC paths Jul 26, 2023
Copy link
Contributor

@rfm rfm left a comment

Choose a reason for hiding this comment

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

Great!

@triplef triplef merged commit 48c8a1a into master Jul 26, 2023
9 checks passed
@triplef triplef deleted the fix-win-network-url branch July 26, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants