Skip to content

Commit 7a61443

Browse files
committed
Minor behavioral fixes
1 parent 556d422 commit 7a61443

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/TSCBasic/Process.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ public final class Process: ObjectIdentifierProtocol {
334334
searchPaths.append(AbsolutePath(String(decodingCString: buffer, as: UTF16.self)))
335335

336336
// The 16-bit Windows system directory
337-
searchPaths.append(AbsolutePath("\(ProcessEnv.vars["systemdrive"] ?? "C:")\\System"))
337+
if let systemDrive = ProcessEnv.vars["systemdrive"],
338+
let systemPath = try? AbsolutePath(validating: "\(systemDrive))\\System") {
339+
searchPaths.append(systemPath)
340+
}
338341

339342
// The Windows directory
340343
GetWindowsDirectoryW(&buffer, .init(MAX_PATH + 1))

Sources/TSCBasic/misc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public func lookupExecutablePath(
9191
guard var value = value, !value.isEmpty else {
9292
return nil
9393
}
94-
let isPath = value.contains("\\")
94+
let isPath = value.contains("\\") || value.contains("/")
9595
if !isPath && !value.contains(".") {
9696
value.append(executableFileSuffix)
9797
}

0 commit comments

Comments
 (0)