Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ extension String {
/// Retrieve the base name of a string that represents a path, removing the
/// directory.
var basename: String {
guard let lastSlash = lastIndex(of: "/") else {
guard let lastSlash = lastIndex(where: {
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(Android) || os(Linux)
["/"].contains($0)
#else
["/", "\\"].contains($0)
#endif
}) else {
return self
}

Expand Down