Skip to content

Commit 1b9ee18

Browse files
authored
Merge pull request swiftlang#2085 from Coeur/patch-2
2 parents 59340e1 + d0e799c commit 1b9ee18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Foundation/URL.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,8 @@ public struct URL : ReferenceConvertible, Equatable {
692692
} else {
693693
// Now we need to do something more expensive
694694
if var c = URLComponents(url: self, resolvingAgainstBaseURL: true) {
695-
c.path = c.path._stringByAppendingPathComponent(pathComponent)
695+
let path = c.path._stringByAppendingPathComponent(pathComponent)
696+
c.path = isDirectory ? path + "/" : path
696697

697698
if let result = c.url {
698699
return result

0 commit comments

Comments
 (0)