diff --git a/NEWS.md b/NEWS.md index 06653fff..c3936727 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,18 @@ # News +## 3.3.2 - 2024-12-21 + +### Fixes + + * Fixed a parse bug with a quoted line with `col_sep` and an empty + line. This was introduced in 3.3.1. + * GH-324 + * Reported by stoodfarback + +### Thanks + + * stoodfarback + ## 3.3.1 - 2024-12-15 ### Improvements diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb index 1e8a3c20..977ec235 100644 --- a/lib/csv/parser.rb +++ b/lib/csv/parser.rb @@ -1041,7 +1041,7 @@ def parse_quotable_robust(&block) quoted_fields << @quoted_column_value elsif parse_row_end if row.empty? and value.nil? - emit_row(row, &block) unless @skip_blanks + emit_row([], &block) unless @skip_blanks else row << value quoted_fields << @quoted_column_value diff --git a/lib/csv/version.rb b/lib/csv/version.rb index 7d00d2f7..925d605a 100644 --- a/lib/csv/version.rb +++ b/lib/csv/version.rb @@ -2,5 +2,5 @@ class CSV # The version of the installed library. - VERSION = "3.3.1" + VERSION = "3.3.2" end diff --git a/test/csv/parse/test_general.rb b/test/csv/parse/test_general.rb index a565ff2e..7ec0994e 100644 --- a/test/csv/parse/test_general.rb +++ b/test/csv/parse/test_general.rb @@ -322,6 +322,15 @@ def test_seeked_string_io CSV.new(input_with_bom).each.to_a) end + def test_quoted_col_sep_and_empty_line + assert_equal([["one,"], [], ["three"]], + CSV.parse(<<-CSV)) +"one," + +"three" + CSV + end + private {