File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -431,7 +431,11 @@ extension Path {
431
431
private struct UNIXPath : Path {
432
432
let string : String
433
433
434
+ #if os(Windows)
435
+ static let root = UNIXPath ( string: " \\ " )
436
+ #else
434
437
static let root = UNIXPath ( string: " / " )
438
+ #endif
435
439
436
440
static func isValidComponent( _ name: String ) -> Bool {
437
441
#if os(Windows)
@@ -550,7 +554,7 @@ private struct UNIXPath: Path {
550
554
var result : [ WCHAR ] = Array < WCHAR > ( repeating: 0 , count: Int ( MAX_PATH + 1 ) )
551
555
552
556
_ = path. standardizingPathSeparator ( ) . withCString ( encodedAs: UTF16 . self) {
553
- PathCchCanonicalize ( $0 , result. length , $0)
557
+ PathCchCanonicalize ( & result , result. count , $0)
554
558
}
555
559
self . init ( string: String ( decodingCString: result, as: UTF16 . self) )
556
560
#else
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public func resolveSymlinks(_ path: AbsolutePath) -> AbsolutePath {
26
26
var resolved : URL = URL ( fileURLWithPath: path. pathString)
27
27
if let destination = try ? FileManager . default. destinationOfSymbolicLink ( atPath: path. pathString) {
28
28
resolved = URL ( fileURLWithPath: destination, relativeTo: URL ( fileURLWithPath: path. pathString) )
29
+ } else {
30
+ return try ! AbsolutePath ( validating: path. pathString)
29
31
}
30
32
31
33
return resolved. standardized. withUnsafeFileSystemRepresentation {
You can’t perform that action at this time.
0 commit comments