aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csv.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 05:59:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 05:59:28 +0000
commit6e00a8b02cdcdf490b5381c62a067ff81728522f (patch)
tree2f03970aca238eda1b68a74a82e4bd24f7bc8a04 /lib/csv.rb
parent291419aa7b94291f27ba021068032f6ccdb03901 (diff)
downloadruby-6e00a8b02cdcdf490b5381c62a067ff81728522f.tar.gz
csv.rb: fix field_size_limit check
* lib/csv.rb (CSV#shift): the last column is an Array in extended column since r55985. [ruby-dev:49964] [Bug #13149] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index 03b87983e6..914acb28c7 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1927,7 +1927,7 @@ class CSV
if @io.eof?
raise MalformedCSVError,
"Unclosed quoted field on line #{lineno + 1}."
- elsif @field_size_limit and csv.last.size >= @field_size_limit
+ elsif @field_size_limit and csv.last.sum(&:size) >= @field_size_limit
raise MalformedCSVError, "Field size exceeded on line #{lineno + 1}."
end
# otherwise, we need to loop and pull some more data to complete the row