From: Dave Thomas Date: 2008-06-17T11:13:35+09:00 Subject: [ruby-core:17286] Re: [Ruby 1.9 - Bug #167] (Open) net/telnet login() method no longer works under 1.9 Yes, indeed it does... Can we get it applied? On Jun 16, 2008, at 5:21 PM, James Gray wrote: > On Jun 15, 2008, at 11:25 PM, Dave Thomas wrote: > >> Issue #167 has been reported by Dave Thomas. >> >> ---------------------------------------- >> Bug #167: net/telnet login() method no longer works under 1.9 >> http://redmine.ruby-lang.org/issues/show/167 > > Does this patch fix Telnet? > > Index: lib/net/telnet.rb > =================================================================== > --- lib/net/telnet.rb (revision 17373) > +++ lib/net/telnet.rb (working copy) > @@ -564,8 +564,8 @@ > @dumplog.log_dump('<', c) if @options.has_key?("Dump_log") > if @options["Telnetmode"] > c = rest + c > - if Integer(c.rindex(/#{IAC}#{SE}/no)) < > - Integer(c.rindex(/#{IAC}#{SB}/no)) > + if Integer(c.rindex(/#{IAC}#{SE}/no) || 0) < > + Integer(c.rindex(/#{IAC}#{SB}/no) || 0) > buf = preprocess(c[0 ... c.rindex(/#{IAC}#{SB}/no)]) > rest = c[c.rindex(/#{IAC}#{SB}/no) .. -1] > elsif pt = c.rindex(/#{IAC} > [^#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]?\z/no) || > > Is it truly intended that nil no longer converts to 0 via Integer? > If so, I'm going to miss that. > > James Edward Gray II > >