Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6647] Inconsistency Behavior Of NSString.deletingPathExtension On macOS vs Linux #3751

Closed
dduan opened this issue Dec 20, 2017 · 1 comment
Assignees

Comments

@dduan
Copy link
Collaborator

dduan commented Dec 20, 2017

Previous ID SR-6647
Radar None
Original Reporter @dduan
Type Bug
Status Closed
Resolution Done
Environment

Xcode Version 9.2 (9C40b)

and

commit c5c6cc8 on swift-corelibs-foundation, master as this bug is filed.

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @dduan
Priority Medium

md5: cf95ee01bcbcf44a1754ba6faca401b1

Issue Description:

The code in question:

NSString(string: "..").deletingPathExtension

On macOS, the result is ".." while on Linux, the result is ".". I think the former makes more sense since ".." represents parent directory on unix and treating part of it as file extension is a bit of a stretch. Another argument for aligning behavior to macOS is the fact that it existed longer therefore has more potential users.

This bug manifests here: https://travis-ci.org/kylef/PathKit/builds/289637066

The PathKit project CI is failing because it relies on this behavior and the example value is being used in tests on both macOS and Linux.

@dduan
Copy link
Collaborator Author

dduan commented Dec 22, 2017

#1376

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant