From 61b723727970478f4e476a6078679a4531084e0c Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 15 Dec 2024 11:56:44 +0900 Subject: [PATCH 1/3] Bump version --- lib/csv/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From abf32b607e2cfe30471e32622d6b38889db59537 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 21 Dec 2024 17:48:04 +0900 Subject: [PATCH 2/3] Fix a parse bug with a quoted line with col_sep and an empty line GitHub: fix GH-324 This is introduced by bb93c289a529c77b5d5a8788dd8fdc03052216fc. We can't reuse `row` in this case because `row` is used for the next row. Reported by stoodfarback. Thanks!!! --- lib/csv/parser.rb | 2 +- test/csv/parse/test_general.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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/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 { From eb20531db25171fe24665e346374ef0dec273082 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 21 Dec 2024 17:53:05 +0900 Subject: [PATCH 3/3] Add 3.3.2 entry --- NEWS.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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