Skip to content

Commit 48dfe9d

Browse files
committed
Bug fix
1 parent 9aef445 commit 48dfe9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/TSCBasic/Path.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,11 @@ extension Path {
431431
private struct UNIXPath: Path {
432432
let string: String
433433

434+
#if os(Windows)
435+
static let root = UNIXPath(string: "\\")
436+
#else
434437
static let root = UNIXPath(string: "/")
438+
#endif
435439

436440
static func isValidComponent(_ name: String) -> Bool {
437441
#if os(Windows)
@@ -550,7 +554,7 @@ private struct UNIXPath: Path {
550554
var result: [WCHAR] = Array<WCHAR>(repeating: 0, count: Int(MAX_PATH + 1))
551555

552556
_ = path.standardizingPathSeparator().withCString(encodedAs: UTF16.self) {
553-
PathCchCanonicalize($0, result.length, $0)
557+
PathCchCanonicalize(&result, result.count, $0)
554558
}
555559
self.init(string: String(decodingCString: result, as: UTF16.self))
556560
#else

0 commit comments

Comments
 (0)