[PATCH] more 1.9 warning fixes

E

Eric Hodel

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top