Skip to content

Commit f395efa

Browse files
authored
Merge pull request #2581 from gmittert/HomeIsAlwaysAbsolute
[Windows] Special case ~ as an absolute path
2 parents 0381c45 + 2f0f99c commit f395efa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/NSPathUtilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ extension String {
125125

126126
internal var isAbsolutePath: Bool {
127127
#if os(Windows)
128-
return !withCString(encodedAs: UTF16.self, PathIsRelativeW)
128+
return hasPrefix("~") || !withCString(encodedAs: UTF16.self, PathIsRelativeW)
129129
#else
130130
return hasPrefix("~") || hasPrefix("/")
131131
#endif

0 commit comments

Comments
 (0)