lib/io_streams/line/reader.rb in iostreams-1.1.0 vs lib/io_streams/line/reader.rb in iostreams-1.1.1
- old
+ new
@@ -92,10 +92,11 @@
line = _readline
if line && @embedded_within
initial_line_number = @line_number
while line.count(@embedded_within).odd?
raise "Unclosed quoted field on line #{initial_line_number}" if eof? || line.length > @buffer_size * 10
+
line << @delimiter
line << _readline
end
end
line
@@ -161,10 +162,10 @@
@buffer << block
else
# Take on the encoding from the input stream
@buffer = block.dup
# Take on the encoding from the first block that was read.
- @read_cache_buffer = ''.encode(block.encoding) if @use_read_cache_buffer
+ @read_cache_buffer = "".encode(block.encoding) if @use_read_cache_buffer
end
if @buffer.size > MAX_BLOCKS_MULTIPLIER * @buffer_size
raise(
Errors::DelimiterNotFound,