From 317b0e5a484ca9117f00ad426d067a5ec6767236 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Aug 2008 17:57:13 +0200 Subject: iplookup plugin: fix brokage from IPv6 support Commit ff949fe1c9dd0c179ecdce9340c04c05242d3a48 "iplookup plugin: support IPv6 too" broke the main iplookup method by forgetting to initialize reply correctly. Fix it, and replace String#+= usage with String#<< which is more efficient speed- and memory-wise. --- data/rbot/plugins/iplookup.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/iplookup.rb b/data/rbot/plugins/iplookup.rb index c983b300..495aa614 100644 --- a/data/rbot/plugins/iplookup.rb +++ b/data/rbot/plugins/iplookup.rb @@ -188,20 +188,21 @@ class IPLookupPlugin < Plugin end def iplookup(m, params) - debug params + reply = "" if params[:domain].match(/^#{Regexp::Irc::HOSTADDR}$/) ip = params[:domain] else begin ip = Resolv.getaddress(params[:domain]) - reply += "#{params[:domain]} | " + reply << "#{params[:domain]} | " rescue => e m.reply "#{e.message}" return end end - reply += ArinWhois.lookup_info(ip) + reply << ArinWhois.lookup_info(ip) + m.reply reply end -- cgit v1.2.3