diff options
author | Sutou Kouhei <[email protected]> | 2021-12-03 06:30:01 +0900 |
---|---|---|
committer | Sutou Kouhei <[email protected]> | 2021-12-24 14:35:33 +0900 |
commit | 56a5ae9f52920982a2f1571a57090772c94c8243 (patch) | |
tree | 5c58b4f62c615d20da69cd4946e8ac99366723e7 /lib/csv/parser.rb | |
parent | d137ce50a1fb438b1fa078f5c54a72b7be30c52a (diff) |
[ruby/csv] Fix a bug that all of ARGF contents may not be consumed
GitHub: fix GH-228
Reported by Rafael Navaza. Thanks!!!
https://github.com/ruby/csv/commit/81f595b6a1
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5336
Diffstat (limited to 'lib/csv/parser.rb')
-rw-r--r-- | lib/csv/parser.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb index f87db3bb12..ef33a69478 100644 --- a/lib/csv/parser.rb +++ b/lib/csv/parser.rb @@ -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 |