Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
This is related to the work on opam-file-format - it's all about
ensuring that files are read with preserved CRLF (so ensuring that
open_in and open_out are only used when text files really are meant to
be being read)
  • Loading branch information
dra27 committed Jul 21, 2018
1 parent d5327ef commit 1feba6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/opamFilename.ml
Expand Up @@ -376,7 +376,7 @@ let with_flock flag ?dontblock file f =
else
"/dev/null"
in
let ch = Pervasives.open_out null in
let ch = Pervasives.open_out_bin null in
Unix.descr_of_out_channel ch, Some ch
| fd ->
fd, None
Expand Down
4 changes: 2 additions & 2 deletions src/core/opamSystem.ml
Expand Up @@ -565,7 +565,7 @@ module Tar = struct

let guess_type f =
try
let ic = open_in f in
let ic = open_in_bin f in
let c1 = input_char ic in
let c2 = input_char ic in
close_in ic;
Expand Down Expand Up @@ -611,7 +611,7 @@ end
module Zip = struct
let is_archive f =
try
let ic = open_in f in
let ic = open_in_bin f in
let c1 = input_char ic in
let c2 = input_char ic in
let c3 = input_char ic in
Expand Down
2 changes: 1 addition & 1 deletion src/repository/opamVCS.ml
Expand Up @@ -109,7 +109,7 @@ module Make (VCS: VCS) = struct
in
let stdout_file =
let f = OpamSystem.temp_file "rsync-files" in
let fd = open_out f in
let fd = open_out_bin f in
List.iter (fun s -> output_string fd s; output_char fd '\n') files;
close_out fd;
f
Expand Down

0 comments on commit 1feba6d

Please sign in to comment.