File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -358,18 +358,15 @@ public final class Process {
358358 if GetSystemDirectoryW ( & buffer, . init( buffer. count) ) > 0 {
359359 searchPaths. append ( AbsolutePath ( String ( decodingCString: buffer, as: UTF16 . self) ) )
360360 }
361- // The 16-bit Windows system directory
362- if let systemDrive = ProcessEnv . vars [ " systemdrive " ] ,
363- let systemPath = try ? AbsolutePath ( validating: " \( systemDrive) ) \\ System " ) {
364- searchPaths. append ( systemPath)
365- }
366- // The Windows directory
367361 if GetWindowsDirectoryW ( & buffer, . init( buffer. count) ) > 0 {
368- searchPaths. append ( AbsolutePath ( String ( decodingCString: buffer, as: UTF16 . self) ) )
362+ let windowsDirectory = String ( decodingCString: buffer, as: UTF16 . self)
363+ // The 16-bit Windows system directory
364+ searchPaths. append ( AbsolutePath ( " \( windowsDirectory) \\ System " ) )
365+ // The Windows directory
366+ searchPaths. append ( AbsolutePath ( windowsDirectory) )
369367 }
370368#endif
371369 searchPaths. append ( contentsOf: envSearchPaths)
372- // Lookup and cache the executable path.
373370 let value = lookupExecutablePath (
374371 filename: program,
375372 currentWorkingDirectory: cwdOpt,
You can’t perform that action at this time.
0 commit comments