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:
parent
d137ce50a1
commit
56a5ae9f52
Notes:
git
2021-12-24 14:35:54 +09:00
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue