]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/getter/http_getter_wget.ml
On-going porting to lablgtk3
[helm.git] / matita / components / getter / http_getter_wget.ml
index 571479d78e1c949ff569fb202a1a45d96f4428c4..0f44f07d590c083fa183dc969cf356175517a7aa 100644 (file)
@@ -40,7 +40,7 @@ let get url =
 let get_and_save url dest_filename =
   let out_channel = open_out dest_filename in
   (try
-    Http_user_agent.get_iter (output_string out_channel) url;
+    Http_user_agent.get_iter (output_bytes out_channel) url;
   with exn ->
     close_out out_channel;
     Sys.remove dest_filename;
@@ -49,11 +49,11 @@ let get_and_save url dest_filename =
 
 let get_and_save_to_tmp url =
   let flat_string s s' c =
-    let cs = String.copy s in
+    let cs = Bytes.of_string s in
     for i = 0 to (String.length s) - 1 do
       if String.contains s' s.[i] then cs.[i] <- c
     done;
-    cs
+    Bytes.to_string cs
   in
   let user = try Unix.getlogin () with _ -> "" in
   let tmp_file =