diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2016-02-09 16:36:05 +0100 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@inria.fr> | 2016-02-10 09:54:19 +0100 |
commit | 5f29a92c0648afd4d9e46de79ab00d0c4b901ff0 (patch) | |
tree | b713c0d90e295f02d52f4664fe93002da70d3e99 /lib | |
parent | 68db732f12980e592c610085192d93457f312607 (diff) |
Don't fail fatally if PATH is not set.
This fixes micromega in certain environments.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/system.ml b/lib/system.ml index 9bdcecef1..0ad43a742 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -149,10 +149,12 @@ let is_in_path lpath filename = with Not_found -> false let is_in_system_path filename = - let path = try Sys.getenv "PATH" - with Not_found -> error "system variable PATH not found" in - let lpath = CUnix.path_to_list path in - is_in_path lpath filename + try + let lpath = CUnix.path_to_list (Sys.getenv "PATH") in + is_in_path lpath filename + with Not_found -> + msg_warning (str "system variable PATH not found"); + false let open_trapping_failure name = try open_out_bin name |