Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby18/lib64/ruby/1.8
File: expect.rb
$expect_verbose = false
[0] Fix | Delete
[1] Fix | Delete
class IO
[2] Fix | Delete
def expect(pat,timeout=9999999)
[3] Fix | Delete
buf = ''
[4] Fix | Delete
case pat
[5] Fix | Delete
when String
[6] Fix | Delete
e_pat = Regexp.new(Regexp.quote(pat))
[7] Fix | Delete
when Regexp
[8] Fix | Delete
e_pat = pat
[9] Fix | Delete
end
[10] Fix | Delete
while true
[11] Fix | Delete
if !IO.select([self],nil,nil,timeout) or eof? then
[12] Fix | Delete
result = nil
[13] Fix | Delete
break
[14] Fix | Delete
end
[15] Fix | Delete
c = getc.chr
[16] Fix | Delete
buf << c
[17] Fix | Delete
if $expect_verbose
[18] Fix | Delete
STDOUT.print c
[19] Fix | Delete
STDOUT.flush
[20] Fix | Delete
end
[21] Fix | Delete
if mat=e_pat.match(buf) then
[22] Fix | Delete
result = [buf,*mat.to_a[1..-1]]
[23] Fix | Delete
break
[24] Fix | Delete
end
[25] Fix | Delete
end
[26] Fix | Delete
if block_given? then
[27] Fix | Delete
yield result
[28] Fix | Delete
else
[29] Fix | Delete
return result
[30] Fix | Delete
end
[31] Fix | Delete
nil
[32] Fix | Delete
end
[33] Fix | Delete
end
[34] Fix | Delete
[35] Fix | Delete
[36] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function