Fix a bug in 1.8.6 where readbyte is not defined.

This commit is contained in:
Chris Eppstein 2010-03-06 16:27:12 -08:00
parent df5c21a725
commit ace0450774

View File

@ -69,6 +69,11 @@ private
private private
def examine(io) def examine(io)
class << io class << io
unless method_defined?(:readbyte)
def readbyte
getc
end
end
def readint; (readbyte << 8) + readbyte; end def readint; (readbyte << 8) + readbyte; end
def readframe; read(readint - 2); end def readframe; read(readint - 2); end
def readsof; [readint, readbyte, readint, readint, readbyte]; end def readsof; [readint, readbyte, readint, readint, readbyte]; end