You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if I reindent a file using LF on Windows the resulting file uses CRLF (and vice-versa). ocp-indent should preserve whatever end-of-line being used in the file.
The text was updated successfully, but these errors were encountered:
diff --git a/src/indentMain.ml b/src/indentMain.ml
index 9a02b8e..162ee3c 100644
--- a/src/indentMain.ml+++ b/src/indentMain.ml@@ -19,7 +19,7 @@ module Args = IndentArgs
let indent_channel ic args config out perm =
let oc, need_close = match out with
| None | Some "-" -> stdout, false
- | Some file -> open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_text] perm file, true+ | Some file -> open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_binary] perm file, true
in
let output = {
IndentPrinter.
@@ -82,7 +82,7 @@ let indent_file args = function
else
args.Args.file_out, 0o644, None
in
- let ic = open_in path in+ let ic = open_in_bin path in
try
indent_channel ic args config out perm;
close_in ic;
Currently, if I reindent a file using LF on Windows the resulting file uses CRLF (and vice-versa).
ocp-indent
should preserve whatever end-of-line being used in the file.The text was updated successfully, but these errors were encountered: