File tree 1 file changed +5
-8
lines changed
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 {
358
358
if GetSystemDirectoryW ( & buffer, . init( buffer. count) ) > 0 {
359
359
searchPaths. append ( AbsolutePath ( String ( decodingCString: buffer, as: UTF16 . self) ) )
360
360
}
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
367
361
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) )
369
367
}
370
368
#endif
371
369
searchPaths. append ( contentsOf: envSearchPaths)
372
- // Lookup and cache the executable path.
373
370
let value = lookupExecutablePath (
374
371
filename: program,
375
372
currentWorkingDirectory: cwdOpt,
You can’t perform that action at this time.
0 commit comments