summaryrefslogtreecommitdiff
path: root/ext/pty/lib/expect.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-09 15:07:34 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-09 15:07:34 +0000
commit5869de449fe535321a1f43d3ca59c22cdf610e9e ()
tree5d45215c48d8c4ea579d2c333e092e43759e1dc1 /ext/pty/lib/expect.rb
parentd124dcf4eb245ced006ff4a3817322d8ecdbaea9 (diff)
* ext/pty/lib/expect.rb: preserve buffer read, instead of discard.
based on a from Luiz Angelo Daros de Luca in [ruby-core:23464]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/pty/lib/expect.rb9
1 files changed, 7 insertions, 2 deletions
@@ -17,12 +17,17 @@ class IO
else
raise TypeError, "unsupported pattern class: #{pattern.class}"
end
while true
- if !IO.select([self],nil,nil,timeout) or eof? then
result = nil
break
end
- c = getc.chr
buf << c
if $expect_verbose
STDOUT.print c