lib/rbbt/util/cmd.rb in rbbt-util-5.5.55 vs lib/rbbt/util/cmd.rb in rbbt-util-5.5.56
- old
+ new
@@ -39,11 +39,11 @@
end
end
end
def close
- self.original_read unless self.eof?
+ self.original_read unless self.closed? or self.eof?
wait_and_status
@post.call if @post
@@ -65,12 +65,12 @@
original_close unless self.closed?
end
def read(*args)
- data = original_read(*args) unless self.eof?
+ data = original_read(*args) unless self.closed? or self.eof?
- self.close if self.eof?
+ self.close if self.eof? and not self.closed?
data
end
end