You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested on macOS with Swift 5.2.4 and Linux with Swift 5.1.5. A unit test targeting using this API targeting Swift 5.3 is failing, so I suppose the bug is still present in the latest release version.
Additional Detail from JIRA
Votes
0
Component/s
Foundation
Labels
Bug
Assignee
None
Priority
Medium
md5: 185106875901dcf51950c3b21e45f49e
Issue Description:
The following code yields different output on macOS (Foundation) vs Linux (SwiftFoundation):
The output on macOS is: "./foo"
The output on Linux is: ".//foo"
Additional test script:
import Foundation let a = NSString(string: "") print(a.appendingPathComponent("foo")) print(a.appendingPathComponent("/foo")) print(a.appendingPathComponent("//foo")) let b = NSString(string: "./") print(b.appendingPathComponent("foo")) print(b.appendingPathComponent("/foo")) print(b.appendingPathComponent("//foo"))
Output on macOS:
foo /foo /foo ./foo ./foo ./foo
Output on Linux:
foo /foo //foo ./foo .//foo .///foo
The following is related: #5582.
The text was updated successfully, but these errors were encountered:
Environment
I've tested on macOS with Swift 5.2.4 and Linux with Swift 5.1.5. A unit test targeting using this API targeting Swift 5.3 is failing, so I suppose the bug is still present in the latest release version.
Additional Detail from JIRA
md5: 185106875901dcf51950c3b21e45f49e
Issue Description:
The following code yields different output on macOS (Foundation) vs Linux (SwiftFoundation):
NSString(string: "./").appendingPathComponent("/foo")
The output on macOS is:
"./foo"
The output on Linux is:
".//foo"
Additional test script:
import Foundation
let a = NSString(string: "")
print(a.appendingPathComponent("foo"))
print(a.appendingPathComponent("/foo"))
print(a.appendingPathComponent("//foo"))
let b = NSString(string: "./")
print(b.appendingPathComponent("foo"))
print(b.appendingPathComponent("/foo"))
print(b.appendingPathComponent("//foo"))
Output on macOS:
foo
/foo
/foo
./foo
./foo
./foo
Output on Linux:
foo
/foo
//foo
./foo
.//foo
.///foo
The following is related: #5582.
The text was updated successfully, but these errors were encountered: