Skip to content

Commit

Permalink
Minor behavioral fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Dec 22, 2020
1 parent 556d422 commit 06b423a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/TSCBasic/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ public final class Process: ObjectIdentifierProtocol {
searchPaths.append(AbsolutePath(String(decodingCString: buffer, as: UTF16.self)))

// The 16-bit Windows system directory
searchPaths.append(AbsolutePath("\(ProcessEnv.vars["systemdrive"] ?? "C:")\\System"))
if let systemDrive = ProcessEnv.vars["systemdrive"] {
searchPaths.append(AbsolutePath("\(systemDrive))\\System"))
}

// The Windows directory
GetWindowsDirectoryW(&buffer, .init(MAX_PATH + 1))
Expand Down
2 changes: 1 addition & 1 deletion Sources/TSCBasic/misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public func lookupExecutablePath(
guard var value = value, !value.isEmpty else {
return nil
}
let isPath = value.contains("\\")
let isPath = value.contains("\\") || value.contains("/")
if !isPath && !value.contains(".") {
value.append(executableFileSuffix)
}
Expand Down

0 comments on commit 06b423a

Please sign in to comment.