Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ocamlbuild: make log printing code tail-recursive

Patch by Frédéric Bour

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit db32d6a7eda45a49f3cfe92ec242423193c7de76 1 parent a72d304
Gabriel Scherer authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 ocamlbuild/ocamlbuild_executor.ml
View
19 ocamlbuild/ocamlbuild_executor.ml
@@ -63,18 +63,15 @@ let output_lines prefix oc buffer =
output_char oc '\n'
in
let rec loop i =
- if i = m then
- ()
+ if i < m then
+ let j =
+ try String.index_from u i '\n'
+ with Not_found -> m
+ in
+ output_line i j;
+ loop (j + 1)
else
- begin
- try
- let j = String.index_from u i '\n' in
- output_line i j;
- loop (j + 1)
- with
- | Not_found ->
- output_line i m
- end
+ ()
in
loop 0
;;
Please sign in to comment.
Something went wrong with that request. Please try again.