@@ -250,40 +250,6 @@ extension Executable: CustomStringConvertible, CustomDebugStringConvertible {
250250 }
251251}
252252
253- extension Executable {
254- internal func possibleExecutablePaths(
255- withPathValue pathValue: String ?
256- ) -> Set < String > {
257- switch self . storage {
258- case . executable( let executableName) :
259- #if os(Windows)
260- // Windows CreateProcessW accepts executable name directly
261- return Set ( [ executableName] )
262- #else
263- var results : Set < String > = [ ]
264- // executableName could be a full path
265- results. insert ( executableName)
266- // Get $PATH from environment
267- let searchPaths : Set < String >
268- if let pathValue = pathValue {
269- let localSearchPaths = pathValue. split ( separator: " : " ) . map { String ( $0) }
270- searchPaths = Set ( localSearchPaths) . union ( Self . defaultSearchPaths)
271- } else {
272- searchPaths = Self . defaultSearchPaths
273- }
274- for path in searchPaths {
275- results. insert (
276- FilePath ( path) . appending ( executableName) . string
277- )
278- }
279- return results
280- #endif
281- case . path( let executablePath) :
282- return Set ( [ executablePath. string] )
283- }
284- }
285- }
286-
287253// MARK: - Arguments
288254
289255/// A collection of arguments to pass to the subprocess.
@@ -304,7 +270,6 @@ public struct Arguments: Sendable, ExpressibleByArrayLiteral, Hashable {
304270 self . executablePathOverride = nil
305271 }
306272
307- #if !os(Windows) // Windows does NOT support arg0 override
308273 /// Create an `Argument` object using the given values, but
309274 /// override the first Argument value to `executablePathOverride`.
310275 /// If `executablePathOverride` is nil,
@@ -321,7 +286,7 @@ public struct Arguments: Sendable, ExpressibleByArrayLiteral, Hashable {
321286 self . executablePathOverride = nil
322287 }
323288 }
324-
289+ #if !os(Windows) // Windows does not support non-unicode arguments
325290 /// Create an `Argument` object using the given values, but
326291 /// override the first Argument value to `executablePathOverride`.
327292 /// If `executablePathOverride` is nil,
@@ -338,12 +303,12 @@ public struct Arguments: Sendable, ExpressibleByArrayLiteral, Hashable {
338303 self . executablePathOverride = nil
339304 }
340305 }
341- #endif
342306
343307 public init ( _ array: [ [ UInt8 ] ] ) {
344308 self . storage = array. map { . rawBytes( $0) }
345309 self . executablePathOverride = nil
346310 }
311+ #endif
347312}
348313
349314extension Arguments : CustomStringConvertible , CustomDebugStringConvertible {
0 commit comments