swiftlang / swift-foundation

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

`URL.path` should not strip trailing slash for root paths on Windows #1038

Closed jrflat closed 2 days ago

jrflat commented 6 days ago

We should not strip the trailing slash when getting the fileSystemPath for C:\ on Windows, since C:\ represents the root while C: does not. Similarly, we should not strip the trailing slash for any UNC path, since the trailing slash might be root.

Resolves https://github.com/swiftlang/swift-foundation/issues/976 and https://github.com/swiftlang/swift-foundation/issues/977

jrflat commented 6 days ago

@swift-ci please test

jrflat commented 5 days ago

@swift-ci please test