1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/csv] Fix a bug that all of ARGF contents may not be consumed

GitHub: fix GH-228

Reported by Rafael Navaza. Thanks!!!

81f595b6a1
This commit is contained in:
Sutou Kouhei 2021-12-03 06:30:01 +09:00 committed by Sutou Kouhei
parent d137ce50a1
commit 56a5ae9f52
Notes: git 2021-12-24 14:35:54 +09:00

View file

@ -768,7 +768,10 @@ class CSV
string = nil
if @samples.empty? and @input.is_a?(StringIO)
string = @input.read
elsif @samples.size == 1 and @input.respond_to?(:eof?) and @input.eof?
elsif @samples.size == 1 and
@input != ARGF and
@input.respond_to?(:eof?) and
@input.eof?
string = @samples[0]
end
if string