diff options
author | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-07 00:56:10 +0000 |
---|---|---|
committer | wakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-07 00:56:10 +0000 |
commit | f7df392eba90ccccdf9411910e86effead5ab1de (patch) | |
tree | f35fed8c323c6ef3ffa327cb6d64c244a9a4caff /lib | |
parent | af7fdcf59e8a207684614aa47655043952a0d2e2 (diff) |
* lib/net/telnet.rb: waitfor(): bug fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/telnet.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb index 1d523c551f..0a520eaabb 100644 --- a/lib/net/telnet.rb +++ b/lib/net/telnet.rb @@ -467,13 +467,14 @@ module Net begin c = @sock.sysread(1024 * 1024) @dumplog.log_dump('<', c) if @options.has_key?("Dump_log") + c = rest + c if @options["Telnetmode"] if Integer(c.rindex(/#{IAC}#{SE}/no)) < Integer(c.rindex(/#{IAC}#{SB}/no)) - buf = preprocess(rest + c[0 ... c.rindex(/#{IAC}#{SB}/no)]) + 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) - buf = preprocess(rest + c[0 ... pt]) + buf = preprocess(c[0 ... pt]) rest = c[pt .. -1] else buf = preprocess(c) |