Skip to content

Comments

Fix NSURL path on Windows for UNC paths#308

Merged
triplef merged 1 commit intomasterfrom
fix-win-network-url
Jul 26, 2023
Merged

Fix NSURL path on Windows for UNC paths#308
triplef merged 1 commit intomasterfrom
fix-win-network-url

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 force-pushed the fix-win-network-url branch from 6267c25 to 902f202 Compare July 26, 2023 13:35
@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
@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