Skip to content

Commit 06b423a

Browse files
committed
Minor behavioral fixes
1 parent 556d422 commit 06b423a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/TSCBasic/Process.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ 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+
searchPaths.append(AbsolutePath("\(systemDrive))\\System"))
339+
}
338340

339341
// The Windows directory
340342
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)