From 601a5f7f8b817f331c54165b20ed6482618b1c62 Mon Sep 17 00:00:00 2001
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date: Thu, 5 Apr 2007 14:27:05 +0000
Subject: Fix a bug introduced in [830]

---
 lib/rbot/ircbot.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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
-- 
cgit v1.2.3