Skip to content

Commit 2733f62

Browse files
authored
Merge pull request #1536 from felix91gr/patch-2
Fix bug of "/" crashing `NSPathUtilities.resolvingSymlinksInPath`
2 parents edf34ca + 2556c03 commit 2733f62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/NSPathUtilities.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public extension NSString {
317317
}
318318

319319
// TODO: pathComponents keeps final path separator if any. Check that logic.
320-
if components.last == "/" {
320+
if components.last == "/" && components.count > 1 {
321321
components.removeLast()
322322
}
323323

0 commit comments

Comments
 (0)