diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-08-22 17:57:13 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-08-22 17:57:13 +0200 |
commit | 317b0e5a484ca9117f00ad426d067a5ec6767236 (patch) | |
tree | 3ed4e270af0f977e61c7cd561d20622865cf5b10 /data | |
parent | 235634f64decfd4c1c20574474faf0267c8772c5 (diff) |
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.
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/iplookup.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 |