[macruby-changes] [4999] MacRuby/trunk/lib/csv.rb

source_changes at macosforge.org source_changes at macosforge.org
Wed Dec 8 19:09:52 PST 2010


Revision: 4999
          http://trac.macosforge.org/projects/ruby/changeset/4999
Author:   watson1978 at gmail.com
Date:     2010-12-08 19:09:48 -0800 (Wed, 08 Dec 2010)
Log Message:
-----------
Fixing a bug that prevented CSV from parsing all multi-line fields correctly. Merged from CRuby 1.9 r28431.
see https://github.com/ruby/ruby/commit/effa0c76d9813a2a823531cf15e4f62702fd1571

Revision Links:
--------------
    http://trac.macosforge.org/projects/ruby/changeset/28431

Modified Paths:
--------------
    MacRuby/trunk/lib/csv.rb

Modified: MacRuby/trunk/lib/csv.rb
===================================================================
--- MacRuby/trunk/lib/csv.rb	2010-12-09 00:43:53 UTC (rev 4998)
+++ MacRuby/trunk/lib/csv.rb	2010-12-09 03:09:48 UTC (rev 4999)
@@ -198,7 +198,7 @@
 #
 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 @@
       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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101208/c471cf25/attachment.html>


More information about the macruby-changes mailing list