lib/grit/git-ruby/object.rb in mojombo-grit-0.9.4 vs lib/grit/git-ruby/object.rb in mojombo-grit-1.1.1
- old
+ new
@@ -161,11 +161,17 @@
end
def self.read_bytes_until(io, char)
string = ''
- while ((next_char = io.getc.chr) != char) && !io.eof
- string += next_char
+ if RUBY_VERSION > '1.9'
+ while ((next_char = io.getc) != char) && !io.eof
+ string += next_char
+ end
+ else
+ while ((next_char = io.getc.chr) != char) && !io.eof
+ string += next_char
+ end
end
string
end