Skip to content

Commit 0ac108a

Browse files
committed
Eio.Process: match Unix search behaviour
Don't search `$PATH` if the name contains a `/`. https://pubs.opengroup.org/onlinepubs/9799919799/ says: > If the file argument contains a <slash> character, the file argument > shall be used as the pathname for this file. Otherwise, the path > prefix for this file is obtained by a search of the directories passed > as the environment variable PATH
1 parent 989fc81 commit 0ac108a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib_eio/unix/process.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
open Eio.Std
22

33
let resolve_program name =
4-
if Filename.is_implicit name then (
4+
if not (String.contains name '/') then (
55
Sys.getenv_opt "PATH"
66
|> Option.value ~default:"/bin:/usr/bin"
77
|> String.split_on_char ':'

0 commit comments

Comments
 (0)