Changeset 317b0e5a484ca9117f00ad426d067a5ec6767236

Show
Ignore:
Timestamp:
08/22/08 19:57:13 (3 months ago)
Author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
git-committer:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1219420633 +0200
git-parent:

[235634f64decfd4c1c20574474faf0267c8772c5]

git-author:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1219420633 +0200
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • data/rbot/plugins/iplookup.rb

    r296cdd0 r317b0e5  
    189189 
    190190  def iplookup(m, params) 
    191     debug params 
     191    reply = "" 
    192192    if params[:domain].match(/^#{Regexp::Irc::HOSTADDR}$/) 
    193193      ip = params[:domain] 
     
    195195      begin 
    196196        ip = Resolv.getaddress(params[:domain]) 
    197         reply += "#{params[:domain]} | " 
     197        reply << "#{params[:domain]} | " 
    198198      rescue => e 
    199199        m.reply "#{e.message}" 
     
    202202    end 
    203203 
    204     reply += ArinWhois.lookup_info(ip) 
     204    reply << ArinWhois.lookup_info(ip) 
     205 
    205206    m.reply reply 
    206207  end