More 1.9 warning fixes

May I apply these patches?

@sspi_enable is not initialized in lib/net/http.rb

pos is shadowed in IRB::OutputFormat#foo, but I don’t see where foo is
called at all, so I removed the method. If #foo is actually used,
removing ‘pos = 0’ would be sufficient.

Index: lib/net/http.rb

— lib/net/http.rb (revision 14512)
+++ lib/net/http.rb (working copy)
@@ -485,6 +485,7 @@ module Net #:nodoc:
@ssl_context = nil
@enable_post_connection_check = true
@compression = nil

  •  @sspi_enabled = false
    end
    
    def inspect
    

Index: lib/irb/output-method.rb

— lib/irb/output-method.rb (revision 14512)
+++ lib/irb/output-method.rb (working copy)
@@ -45,21 +45,6 @@ module IRB
return format, opts if $1.size % 2 == 1
end

  • def foo(format)
  •  pos = 0
    
  •  inspects = []
    
  •  format.scan(/%[#0\-+ ]?(\*(?=[^0-9])|\*[1-9][0-9]*\$|[1-9]
    

[0-9](?=[^0-9]))?(.(*(?=[^0-9])|*[1-9][0-9]$|[1-9][0-9](?
=[^0-9])))?(([1-9][0-9]
$)*)([diouxXeEfgGcsb%])/) {|f, p, pp, pos,
new_pos, c|

  • puts [f, p, pp, pos, new_pos, c].join("!")
  • pos = new_pos if new_pos
  • if c == “I”
  • inspects.push pos.to_i
  • (f||"")+(p||"")+(pp||"")+(pos||"")+“s”
  • else
  • $&
  • end
  •  }
    
  • end
  • def puts(*objs)
      for obj in objs
    
    print(*obj)

Hi,

In message “Re: [PATCH] more 1.9 warning fixes”
on Sun, 23 Dec 2007 17:10:11 +0900, Eric H.
[email protected] writes:

|May I apply these patches?
|
|@sspi_enable is not initialized in lib/net/http.rb
|
|pos is shadowed in IRB::OutputFormat#foo, but I don’t see where foo is
|called at all, so I removed the method. If #foo is actually used,
|removing ‘pos = 0’ would be sufficient.

Yes.

          matz.