aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-11-30 17:58:22 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-11-30 17:58:22 +0100
commit05f604d7f6e5ca3a0b005ae7ae1073f2b9e83207 (patch)
treede315f996fc09dfb0e21d2737afff9abb7a09981
parent730966facd095f87620aa8d0798ccac7e36aa589 (diff)
downloadcompcert-kvx-05f604d7f6e5ca3a0b005ae7ae1073f2b9e83207.tar.gz
compcert-kvx-05f604d7f6e5ca3a0b005ae7ae1073f2b9e83207.zip
Open files in binary mode.
On windows opening files in text mode can result in errors due to non-windows compatible input. Thus open files only in binary mode. Bug 17664
-rw-r--r--cparser/Parse.ml2
-rw-r--r--lib/Readconfig.mll3
2 files changed, 2 insertions, 3 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml
index 1d92d5a5..c125e653 100644
--- a/cparser/Parse.ml
+++ b/cparser/Parse.ml
@@ -39,7 +39,7 @@ let parse_transformations s =
!t
let read_file sourcefile =
- let ic = open_in sourcefile in
+ let ic = open_in_bin sourcefile in
let n = in_channel_length ic in
let text = really_input_string ic n in
close_in ic;
diff --git a/lib/Readconfig.mll b/lib/Readconfig.mll
index ec2f6bb0..6cb3409d 100644
--- a/lib/Readconfig.mll
+++ b/lib/Readconfig.mll
@@ -82,7 +82,7 @@ and doublequote = parse
(* The entry point *)
let read_config_file filename =
- let ic = open_in filename in
+ let ic = open_in_bin filename in
let lexbuf = Lexing.from_channel ic in
Lexing.(lexbuf.lex_start_p <- {lexbuf.lex_start_p with pos_fname = filename});
try
@@ -108,4 +108,3 @@ let _ =
*)
}
-