Fixed easy input parsing bug

This commit is contained in:
Neale Pickett 2008-03-02 21:34:27 -07:00
parent b55baf1e92
commit ba2f2ef892
2 changed files with 3 additions and 4 deletions

View File

@ -97,7 +97,8 @@ let handle_input cli =
| [] -> | [] ->
() ()
| [leftover] -> | [leftover] ->
String.blit leftover 0 cli.ibuf 0 (String.length leftover) cli.ibuf_len := (String.length leftover);
String.blit leftover 0 cli.ibuf 0 !(cli.ibuf_len)
| line :: tl -> | line :: tl ->
let parsed = Command.from_string line in let parsed = Command.from_string line in
!(cli.handle_command) cli parsed; !(cli.handle_command) cli parsed;

View File

@ -27,9 +27,7 @@ let unit_tests =
(Command.from_string ":foo NICK name"); (Command.from_string ":foo NICK name");
assert_equal assert_equal
~printer:Command.as_string ~printer:Command.as_string
(Command.create (Command.create (Some "foo.bar") "PART" ["#foo"; "#bar"]
(Some "foo.bar")
"PART" ["#foo"; "#bar"]
(Some "ta ta")) (Some "ta ta"))
(Command.from_string ":foo.bar PART #foo #bar :ta ta"); (Command.from_string ":foo.bar PART #foo #bar :ta ta");
) )