From: Giuseppe Bilotta Date: Thu, 5 Apr 2007 14:27:05 +0000 (+0000) Subject: Fix a bug introduced in [830] X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=601a5f7f8b817f331c54165b20ed6482618b1c62;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Fix a bug introduced in [830] --- diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 036c0508..e5039248 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -894,9 +894,10 @@ class Bot end }.flatten - if all_lines.length > opts[:max_lines] + if opts[:max_lines] > 0 and all_lines.length > opts[:max_lines] lines = all_lines[0...opts[:max_lines]] - lines.last = lines.last.slice(0, left - truncate.size) << truncate + lines.last.slice!(0, left - truncate.size) + lines.last << truncate else lines = all_lines end