Skip to content

Commit 9f9c338

Browse files
authored
Merge pull request #5797 from last-genius/private/asultanov/opt-fix
Fixes: 99c4356 ("Transition from exception-raising Unix.getenv to Sys.getenv_opt with")
2 parents 5519cf9 + d26f870 commit 9f9c338

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ocaml/xapi-idl/lib/xcp_service.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ let canonicalise x =
371371
split_c ':' (Option.value (Sys.getenv_opt "PATH") ~default:"")
372372
in
373373
let first_hit =
374-
List.find_opt
374+
List.find_map
375375
(fun path ->
376376
let possibility = Filename.concat path x in
377-
Sys.file_exists possibility
377+
if Sys.file_exists possibility then Some possibility else None
378378
)
379379
(paths @ !extra_search_path)
380380
in

0 commit comments

Comments
 (0)