Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Mar 7, 2021
1 parent 9aef445 commit 48dfe9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/TSCBasic/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,11 @@ extension Path {
private struct UNIXPath: Path {
let string: String

#if os(Windows)
static let root = UNIXPath(string: "\\")
#else
static let root = UNIXPath(string: "/")
#endif

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

_ = path.standardizingPathSeparator().withCString(encodedAs: UTF16.self) {
PathCchCanonicalize($0, result.length, $0)
PathCchCanonicalize(&result, result.count, $0)
}
self.init(string: String(decodingCString: result, as: UTF16.self))
#else
Expand Down

0 comments on commit 48dfe9d

Please sign in to comment.