Skip to content

Commit

Permalink
Ignore trailing CR when echo-ing commands output
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Heuzard committed Jun 14, 2024
1 parent 48528b6 commit c1d24df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ocamlbuild_executor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ let output_lines prefix oc buffer =
try String.index_from u i '\n'
with Not_found -> m
in
output_line i j;
(* ignore trailing CR *)
let k = ref j in
while !k > i && u.[!k - 1] = '\r' do decr k done;
output_line i !k;
loop (j + 1)
else
()
Expand Down

0 comments on commit c1d24df

Please sign in to comment.