summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2003-07-25 12:17:19 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2003-07-25 12:17:19 +0000
commit5385770407281a022bd7bca87efb949a6f1cc4c6 (patch)
tree11aee744245ca3bd6b202d2e75f9894e130e31f4 /driver
parented53ef381a9e0c3ccbbab11cdcc23d8b9b11d903 (diff)
downloadocaml-5385770407281a022bd7bca87efb949a6f1cc4c6.tar.gz
Bug dans l'initialisation de load_path au toplevel (PR#1770,1775)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver')
-rw-r--r--driver/compile.ml5
-rw-r--r--driver/optcompile.ml3
2 files changed, 6 insertions, 2 deletions
diff --git a/driver/compile.ml b/driver/compile.ml
index 9f4f9bc058..52cf87d4a4 100644
--- a/driver/compile.ml
+++ b/driver/compile.ml
@@ -37,8 +37,9 @@ let init_path () =
(* Return the initial environment in which compilation proceeds. *)
+(* Note: do not do init_path() in initial_env, this breaks
+ toplevel initialization (PR#1775) *)
let initial_env () =
- init_path();
Ident.reinit();
try
if !Clflags.nopervasives
@@ -50,6 +51,7 @@ let initial_env () =
(* Compile a .mli file *)
let interface ppf sourcefile =
+ init_path();
let prefixname = chop_extension_if_any sourcefile in
let modulename = String.capitalize(Filename.basename prefixname) in
let inputfile = Pparse.preprocess sourcefile in
@@ -78,6 +80,7 @@ let print_if ppf flag printer arg =
let (++) x f = f x
let implementation ppf sourcefile =
+ init_path();
let prefixname = chop_extension_if_any sourcefile in
let modulename = String.capitalize(Filename.basename prefixname) in
let inputfile = Pparse.preprocess sourcefile in
diff --git a/driver/optcompile.ml b/driver/optcompile.ml
index 5b7697a5e0..0e52920f39 100644
--- a/driver/optcompile.ml
+++ b/driver/optcompile.ml
@@ -37,7 +37,6 @@ let init_path () =
(* Return the initial environment in which compilation proceeds. *)
let initial_env () =
- init_path();
Ident.reinit();
try
if !Clflags.nopervasives
@@ -49,6 +48,7 @@ let initial_env () =
(* Compile a .mli file *)
let interface ppf sourcefile =
+ init_path();
let prefixname = Misc.chop_extension_if_any sourcefile in
let modulename = String.capitalize(Filename.basename prefixname) in
let inputfile = Pparse.preprocess sourcefile in
@@ -78,6 +78,7 @@ let (++) x f = f x
let (+++) (x, y) f = (x, f y)
let implementation ppf sourcefile =
+ init_path();
let prefixname = Misc.chop_extension_if_any sourcefile in
let modulename = String.capitalize(Filename.basename prefixname) in
let inputfile = Pparse.preprocess sourcefile in