Skip to content

Conversation

@jrflat
Copy link
Contributor

@jrflat jrflat commented Aug 14, 2024

Currently URL.fileSystemPath only drops the last trailing slash. It should drop all of them so that we get:

let path = “/path///“
let url = URL(filePath: path)
print(url.fileSystemPath) // "/path" (previously "/path//" having one less trailing slash)

@jrflat jrflat requested a review from jmschonfeld August 14, 2024 22:16
@jrflat
Copy link
Contributor Author

jrflat commented Aug 14, 2024

@swift-ci please test

@jrflat jrflat force-pushed the drop-trailing-slashes branch from 3656a59 to 4e5d318 Compare August 15, 2024 03:58
@jrflat
Copy link
Contributor Author

jrflat commented Aug 15, 2024

@swift-ci please test

@jrflat jrflat merged commit 83073e2 into swiftlang:main Aug 16, 2024
jrflat added a commit to jrflat/swift-foundation that referenced this pull request Oct 8, 2024
@jrflat jrflat mentioned this pull request Oct 8, 2024
jrflat added a commit to jrflat/swift-foundation that referenced this pull request Oct 14, 2024
jrflat added a commit that referenced this pull request Oct 14, 2024
* (133878310) URL.fileSystemPath should drop all trailing slashes (#852)

* (133882014) URL(filePath: path, directoryHint: .notDirectory) should strip trailing slashes (#867)

* (137129292) URL(filePath:) should not treat "~" as absolute (#961)

* (137068266) URL.fileSystemPath should strip leading slash for Windows drive letters (#964)

* (137287143) URL path extension APIs should strip trailing slashes (#965)
jrflat added a commit that referenced this pull request Oct 14, 2024
* (133878310) URL.fileSystemPath should drop all trailing slashes (#852)

* (133882014) URL(filePath: path, directoryHint: .notDirectory) should strip trailing slashes (#867)

* (137129292) URL(filePath:) should not treat "~" as absolute (#961)

* (137068266) URL.fileSystemPath should strip leading slash for Windows drive letters (#964)

* (137287143) URL path extension APIs should strip trailing slashes (#965)
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
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.

3 participants