diff options
| author | Hugo Herbelin | 2015-05-20 14:36:41 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2015-05-20 22:48:06 +0200 |
| commit | 69941d4e195650bf59285b897c14d6287defea0f (patch) | |
| tree | 572c43bd2c6ca5fd53d364a90b21e390bc50a87e /lib/system.ml | |
| parent | 5a52a74592496353d562d9f3e958fb59ab585531 (diff) | |
Continuing incomplete 4b5af0d6e9ec1 (on MacOS X, ensuring that files
found in the file system have the expected lowercase/uppercase
spelling)
Diffstat (limited to 'lib/system.ml')
| -rw-r--r-- | lib/system.ml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/system.ml b/lib/system.ml index 6364035e16..1a67120b60 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -53,12 +53,11 @@ let all_subdirs ~unix_path:root = if exists_dir root then traverse root []; List.rev !l -let file_really_exists f = +let file_exists_respecting_case f = if Coq_config.arch = "Darwin" then (* ensure that the file exists with expected case on the case-insensitive but case-preserving default MacOS file system *) let rec aux f = - Printf.eprintf ".%!"; let bf = Filename.basename f in let df = Filename.dirname f in String.equal df "." || String.equal df "/" || @@ -90,7 +89,7 @@ let where_in_path ?(warn=true) path filename = in check_and_warn (search path (fun lpe -> let f = Filename.concat lpe filename in - if Sys.file_exists f then [lpe,f] else [])) + if file_exists_respecting_case f then [lpe,f] else [])) let where_in_path_rex path rex = search path (fun lpe -> @@ -106,7 +105,7 @@ let where_in_path_rex path rex = let find_file_in_path ?(warn=true) paths filename = if not (Filename.is_implicit filename) then - if Sys.file_exists filename then + if file_exists_respecting_case filename then let root = Filename.dirname filename in root, filename else |
