From: Giuseppe Bilotta Date: Mon, 5 Feb 2007 12:13:09 +0000 (+0000) Subject: Fix horrible bug in reworked sendmsg code that prevented it from working correctly... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=74650a43a45e67a35deb72375a6c0d2cbb64b79e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Fix horrible bug in reworked sendmsg code that prevented it from working correctly with messages with embedded newlines --- diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 956415f9..5cd0ac4d 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -792,7 +792,7 @@ class IrcBot if(left >= msg.length) sendq "#{fixed}#{msg}", chan, ring log_sent(type, where, msg) - return + break end if opts[:max_lines] and cmd_lines == max_lines - 1 debug "Max lines count reached for message #{original_message.inspect} while sending #{msg.inspect}, truncating" @@ -816,8 +816,8 @@ class IrcBot end sendq "#{fixed}#{line}", chan, ring log_sent(type, where, line) - cmd_lines += 1 end while(msg.length > 0) + cmd_lines += 1 } end