From e6386049f0c2b9cbd2f61726b42d7b575210faa3 Mon Sep 17 00:00:00 2001 From: spiralvoice Date: Sun, 18 Jul 2010 14:49:59 +0000 Subject: [PATCH] patch #7251 --- distrib/ChangeLog | 1 + src/networks/bittorrent/bTInteractive.ml | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/distrib/ChangeLog b/distrib/ChangeLog index a2142eff..368d7234 100644 --- a/distrib/ChangeLog +++ b/distrib/ChangeLog @@ -15,6 +15,7 @@ ChangeLog ========= 2010/07/18 +7251: BT: OCaml 3.08.3 compatibility fix (ygrek) 7250: DC: discover self IP (ygrek) 7249: DC: fix parsing MyINFO with non-latin nicks (ygrek) diff --git a/src/networks/bittorrent/bTInteractive.ml b/src/networks/bittorrent/bTInteractive.ml index 471a99b4..eb7bc330 100644 --- a/src/networks/bittorrent/bTInteractive.ml +++ b/src/networks/bittorrent/bTInteractive.ml @@ -1052,7 +1052,12 @@ let compute_torrent filename announce comment = Filename.concat (Sys.getcwd ()) torrent_path, try `Ok (BTTracker.track_torrent basename file_id) with exn -> `Err (Printexc2.to_string exn) -let text fmt = Printf.ksprintf (fun s -> `Text s) fmt +(* let text fmt = Printf.ksprintf (fun s -> `Text s) fmt *) +(* + OCaml 3.08.3 compatibility (ksprintf not available) + http://mldonkey.sourceforge.net/phpBB2/viewtopic.php?p=30453 +*) +let text s = `Text s let link name url = `Link (name,url) let output buf typ elements = @@ -1105,16 +1110,16 @@ let commands = let (path,url) = compute_torrent !filename "" !comment in [ - text "Torrent file generated : %s" path; + text (Printf.sprintf "Torrent file generated : %s" path); `Break; (match url with | `Ok url -> link "Download" url - | `Err s -> text "Not tracked : %s" s); + | `Err s -> text (Printf.sprintf "Not tracked : %s" s)); `Break ] with | Not_found -> [text "Not enough parameters"; `Break] - | exn -> [text "Error: %s" (Printexc2.to_string exn); `Break] + | exn -> [text (Printf.sprintf "Error: %s" (Printexc2.to_string exn)); `Break] end; "" ), _s " [] :\tgenerate the corresponding .torrent file with .\n\t\t\t\t\t\tThe file is automatically tracked if tracker is enabled and seeded if located in incoming/"; -- 2.11.4.GIT