File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -225,9 +225,9 @@ public func lookupExecutablePath(
225
225
return nil
226
226
}
227
227
#if os(Windows)
228
- let isPath = value. contains ( " : " ) || value. contains ( " \\ " ) || value. contains ( " / " )
228
+ let isFileName = ! value. contains ( " : " ) && ! value. contains ( " \\ " ) && ! value. contains ( " / " )
229
229
#else
230
- let isPath = value. contains ( " / " )
230
+ let isFileName = ! value. contains ( " / " )
231
231
#endif
232
232
233
233
var paths : [ AbsolutePath ] = [ ]
@@ -241,8 +241,8 @@ public func lookupExecutablePath(
241
241
paths. append ( absPath)
242
242
}
243
243
244
- // Ensure the value is not a path.
245
- if !isPath {
244
+ // Only search in PATH if the value is a single path component .
245
+ if isFileName {
246
246
// Try to locate in search paths.
247
247
paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
248
248
#if os(Windows)
You can’t perform that action at this time.
0 commit comments