summaryrefslogtreecommitdiff
path: root/lib/csv.rb
diff options
context:
space:
mode:
authorjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-25 02:59:20 +0000
committerjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-25 02:59:20 +0000
commiteffa0c76d9813a2a823531cf15e4f62702fd1571 (patch)
tree05d46f37c78183324b34eb2298be1947e9b6215c /lib/csv.rb
parent89a3e2ed7acd822f23caa69b4d384e767c7140d7 (diff)
* lib/csv.rb: Fixing a bug that prevented CSV from parsing
all multi-line fields correctly. Patch by Rob Biedenham. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index d3a295b3a8..8685e3d658 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -198,7 +198,7 @@ require "stringio"
#
class CSV
# The version of the installed library.
- VERSION = "2.4.6".freeze
+ VERSION = "2.4.7".freeze
#
# A CSV::Row is part Array and part Hash. It retains an order for the fields
@@ -1843,7 +1843,13 @@ class CSV
end
parts = parse.split(@col_sep, -1)
- csv << nil if parts.empty?
+ if parts.empty?
+ if in_extended_col
+ csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop
+ else
+ csv << nil
+ end
+ end
# This loop is the hot path of csv parsing. Some things may be non-dry
# for a reason. Make sure to benchmark when refactoring.