diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 09:17:09 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 09:17:09 +0000 |
commit | 3b77cb2a64315e5bb7b2eb9af08cbca5db434ce2 (patch) | |
tree | 44ea2269669ca8c033d877e3bd36012581957fa7 /lib/csv.rb | |
parent | 59faac613f896e9f4287738c96805c96588d78c1 (diff) |
Added accessor of original line when parsing.
[Feature #11865][ruby-core:72452][fix GH-1170]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index 914acb28c7..30e4b23586 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -1656,7 +1656,7 @@ class CSV # The line number of the last row read from this file. Fields with nested # line-end characters will not affect this count. # - attr_reader :lineno + attr_reader :lineno, :line ### IO and StringIO Delegation ### @@ -1831,6 +1831,12 @@ class CSV return nil end + if in_extended_col + @line.concat(parse) + else + @line = parse.clone + end + parse.sub!(@parsers[:line_end], "") if csv.empty? |