swiftlang / swift-foundation

The Foundation project
Apache License 2.0
2.4k stars 159 forks source link

`URL.path` includes leading Slash if the URL points to the root directory of a drive on Windows #977

Open ahoppen opened 1 month ago

ahoppen commented 1 month ago
print(URL(fileURLWithPath: #"C:\"#).path)

prints /C:. It should print C:\.

Also see https://github.com/swiftlang/swift-foundation/issues/976, which is related.

jmschonfeld commented 1 month ago

I think this was likely resolved by https://github.com/swiftlang/swift-foundation/pull/964 (unless this issue is specifically about something like C:\ only and not C:\foo?)

ahoppen commented 1 month ago

It specific about C:\. I don't see the issue with non-root URLs