Skip to content

Commit

Permalink
appendingPathComponent(:isDirectory:) should account for isDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Apr 10, 2019
1 parent 8e5dbcf commit 4c30f8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/public/Darwin/Foundation/URL.swift
Expand Up @@ -827,7 +827,8 @@ public struct URL : ReferenceConvertible, Equatable {
} else {
// Now we need to do something more expensive
if var c = URLComponents(url: self, resolvingAgainstBaseURL: true) {
c.path = (c.path as NSString).appendingPathComponent(pathComponent)
let path = (c.path as NSString).appendingPathComponent(pathComponent)
c.path = isDirectory ? path + "/" : path

if let result = c.url {
return result
Expand Down

0 comments on commit 4c30f8b

Please sign in to comment.