mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Tue, 23 May 2006 17:39:01 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/05/23 17:39:01

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonGlobals.ml 

Log message:
        patch #5123

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.848&tr2=1.849&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonGlobals.ml.diff?tr1=1.65&tr2=1.66&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.848 mldonkey/distrib/ChangeLog:1.849
--- mldonkey/distrib/ChangeLog:1.848    Tue May 23 17:38:25 2006
+++ mldonkey/distrib/ChangeLog  Tue May 23 17:39:01 2006
@@ -17,6 +17,7 @@
 2006/05/23
 5121: EDK: Remove obsolete option emule_compression
 5122: improve block_list output and runinfo ip blocking (schlumpf)
+5123: Fix Invalid_argument("UTF8.length") bug in HTML, down-/uploaders
 -------------------------------------------------------------------------------
 2006/05/21: version 2.7.6 = tag release-2-7-6
 5119: HTML, Options: Include Wiki link in options names
Index: mldonkey/src/daemon/common/commonGlobals.ml
diff -u mldonkey/src/daemon/common/commonGlobals.ml:1.65 
mldonkey/src/daemon/common/commonGlobals.ml:1.66
--- mldonkey/src/daemon/common/commonGlobals.ml:1.65    Sun May 21 07:50:04 2006
+++ mldonkey/src/daemon/common/commonGlobals.ml Tue May 23 17:39:01 2006
@@ -107,11 +107,16 @@
 let find_other_port = ref false
 
 let shorten str limit =
-  (* TODO: we schould change all strings to utf8 when
+  (* TODO: we should change all strings to utf8 when
      they come into the core instead. *)
   let name = Charset.to_utf8 (* String.escaped *) str in
-  let len = Charset.utf8_length str in
-  let diff_len_utf8_ascii = (String.length str) - len in
+  let slen = String.length str in
+  let len =
+    try
+      Charset.utf8_length str
+    with e -> slen
+  in
+  let diff_len_utf8_ascii = slen - len in
   let max_len = maxi limit 10 in
   if len > max_len then
     let prefix = String.sub name 0 (max_len - 7 + diff_len_utf8_ascii) in




reply via email to

[Prev in Thread] Current Thread [Next in Thread]