summaryrefslogtreecommitdiff
path: root/lib/envars.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/envars.ml')
-rw-r--r--lib/envars.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/envars.ml b/lib/envars.ml
index b0eed838..679e3fdf 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -39,6 +39,8 @@ let path_to_list p =
let user_path () =
path_to_list (Sys.getenv "PATH") (* may raise Not_found *)
+(* Finding a name in path using the equality provided by the file system *)
+(* whether it is case-sensitive or case-insensitive *)
let rec which l f =
match l with
| [] ->
@@ -99,7 +101,8 @@ let _ =
(** [check_file_else ~dir ~file oth] checks if [file] exists in
the installation directory [dir] given relatively to [coqroot].
If this Coq is only locally built, then [file] must be in [coqroot].
- If the check fails, then [oth ()] is evaluated. *)
+ If the check fails, then [oth ()] is evaluated.
+ Using file system equality seems well enough for this heuristic *)
let check_file_else ~dir ~file oth =
let path = if Coq_config.local then coqroot else coqroot / dir in
if Sys.file_exists (path / file) then path else oth ()