From: Lloyd Zusman Date: 2001-08-07T21:16:21+09:00 Subject: [ruby-talk:19282] PATCH: fixed bug in "waitfor" in net/telnet.rb I'm using the Net::Telnet module and I'm quite happy with it. However, it has a bug. The "waitfor" method in Net::Telnet doesn't properly return the remote data when it's not running in Telnetmode. This causes "waitfor" to always hang and time out when trying to match data in non-Telnetmode. This patch for net/telnet.rb fixes the problem. Thank you very much for considering this patch. --- telnet.rb.orig Tue Aug 7 08:05:51 2001 +++ telnet.rb Tue Aug 7 08:13:54 2001 @@ -485,6 +485,14 @@ buf = preprocess(c) rest = '' end + else + # Not Telnetmode. + # + # We cannot use preprocess() on this data, because that + # method makes some Telnetmode-specific assumptions. + buf = c + buf.gsub!(/#{EOL}/no, "\n") unless @options["Binmode"] + rest = '' end @log.print(buf) if @options.has_key?("Output_log") line.concat(buf) -- Lloyd Zusman ljz@asfast.com