aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEnrico Tassi2014-10-24 14:57:45 +0200
committerEnrico Tassi2014-10-24 14:57:49 +0200
commit68f1213aa5ad4c9e03f4cb64e2474399b855c4f8 (patch)
tree2c8cc9b089f7978c36e35f66975694926b157ded /lib
parente5f210f51f1dc546fed9fcb986648de8f1302f68 (diff)
-help failing (fix 3762)
Diffstat (limited to 'lib')
-rw-r--r--lib/system.ml16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/system.ml b/lib/system.ml
index a2f339b1d3..b0b5aa1a8c 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -81,13 +81,15 @@ let where_in_path ?(warn=true) path filename =
let where_in_path_rex path rex =
search path (fun lpe ->
- let files = Sys.readdir lpe in
- CList.map_filter (fun name ->
- try
- ignore(Str.search_forward rex name 0);
- Some (lpe,Filename.concat lpe name)
- with Not_found -> None)
- (Array.to_list files))
+ try
+ let files = Sys.readdir lpe in
+ CList.map_filter (fun name ->
+ try
+ ignore(Str.search_forward rex name 0);
+ Some (lpe,Filename.concat lpe name)
+ with Not_found -> None)
+ (Array.to_list files)
+ with Sys_error _ -> [])
let find_file_in_path ?(warn=true) paths filename =
if not (Filename.is_implicit filename) then