]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Fix a bug introduced in [830]
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Apr 2007 14:27:05 +0000 (14:27 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Apr 2007 14:27:05 +0000 (14:27 +0000)
lib/rbot/ircbot.rb

index 036c0508e381d218162d3600657f95d77a35f437..e503924817f66abf8406e37c224a8660f1b01461 100644 (file)
@@ -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