aboutsummaryrefslogtreecommitdiffhomepage
path: root/library
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2000-12-15 11:28:58 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2000-12-15 11:28:58 +0000
commit2922fb80fe14463fee6a5625c84aed14e95d6640 (patch)
treeb32c1a9cb0e677455009d8a7ce1373ccc3796080 /library
parent435394d69be36194697f0231b29544eea90c219f (diff)
RĂ©paration de bugs de LoadPath
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1123 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
-rw-r--r--library/library.ml12
1 files changed, 7 insertions, 5 deletions
diff --git a/library/library.ml b/library/library.ml
index f2468d32d..6839bdb9c 100644
--- a/library/library.ml
+++ b/library/library.ml
@@ -20,11 +20,11 @@ let add_load_path_entry lpe = load_path := lpe :: !load_path
let add_path dir coq_dirpath =
if coq_dirpath = [] then anomaly "add_path: empty path in library";
Nametab.push_library_root (List.hd coq_dirpath);
- if (Unix.stat dir).Unix.st_kind = Unix.S_DIR then
- add_load_path_entry
- { directory = dir; coq_dirpath = coq_dirpath }
+ if exists_dir dir then
+ add_load_path_entry { directory = dir; coq_dirpath = coq_dirpath }
else
- error (dir ^ " is not an existant directory")
+ wARNING [< 'sTR ("Cannot open " ^ dir) >]
+
let remove_path dir =
load_path := List.filter (fun lpe -> lpe.directory <> dir) !load_path
@@ -32,7 +32,9 @@ let remove_path dir =
let rec_add_path dir coq_dirpath =
if coq_dirpath = [] then anomaly "add_path: empty path in library";
Nametab.push_library_root (List.hd coq_dirpath);
- load_path := (all_subdirs dir (Some coq_dirpath)) @ !load_path
+ let dirs = all_subdirs dir (Some coq_dirpath) in
+ if dirs = [] then wARNING [< 'sTR ("Cannot open " ^ dir) >];
+ load_path := dirs @ !load_path
(*s Modules on disk contain the following informations (after the magic
number, and before the digest). *)