Skip to content

Commit c581d4e

Browse files
committed
Fix util copy function
1 parent f8226f7 commit c581d4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/odoc/fs.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ module File = struct
115115
with_ic src (fun ic ->
116116
mkdir_p (dirname dst);
117117
with_oc dst (fun oc ->
118-
let len = 1024 in
118+
let len = 65536 in
119119
let buf = Bytes.create len in
120120
let rec loop () =
121121
let read = input ic buf 0 len in
122-
output oc buf 0 read;
123-
if read = len then loop ()
122+
if read > 0 then (
123+
output oc buf 0 read;
124+
loop ())
124125
in
125126
Ok (loop ())))
126127
with Sys_error e -> Result.Error (`Msg e)

0 commit comments

Comments
 (0)