/[mldonkey]/mldonkey/src/daemon/chat/chat_misc.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/chat/chat_misc.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by simon_mld, Tue Apr 22 22:33:39 2003 UTC revision 1.2 by spiralvoice, Tue Sep 6 11:24:59 2005 UTC
# Line 49  let buf_get_line buf = Line 49  let buf_get_line buf =
49      let n = String.index s '\n' in      let n = String.index s '\n' in
50      let s1 = String.sub s 0 n in      let s1 = String.sub s 0 n in
51      let s2 = String.sub s n ((String.length s) - n) in      let s2 = String.sub s n ((String.length s) - n) in
52      Buffer.clear buf;      Buffer.reset buf;
53      Buffer.add_string buf s2;      Buffer.add_string buf s2;
54      match s1 with      match s1 with
55        "" -> raise End_of_file        "" -> raise End_of_file
56      | _ -> s1      | _ -> s1
57    with    with
58      Not_found ->      Not_found ->
59        Buffer.clear buf;        Buffer.reset buf;
60        s        s
61    
62  let buf_input buf str pos len =  let buf_input buf str pos len =
63    let s = Buffer.contents buf in    let s = Buffer.contents buf in
64    Buffer.clear buf;    Buffer.reset buf;
65    let s1 =    let s1 =
66      try String.sub s 0 len      try String.sub s 0 len
67      with _ -> raise End_of_file      with _ -> raise End_of_file

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26