-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
When decrypting streaming and splitting files per line appears to loose \r\n or \n line endings when using Reader#read(1024).
Using without the limit doesn't lose the line endings.
Affected code
Bzip2::FFI::Reader.open(io_or_path) do |reader|
while buffer = reader.read(1024) do
line = buffer.split("\n")
# process uncompressed line from the buffer
end
endWork around
Bzip2::FFI::Reader.open(io_or_path) do |reader|
while buffer = reader.read do
line = buffer.split("\n")
# process uncompressed line from the buffer
end
endThe issue might be somewhere around the code paths for default 4kb vs limit branch of read.
https://github.com/philr/bzip2-ffi/blob/7202391117e6709bc67404c1f55d4a3f5d3bc791/lib/bzip2/ffi/reader.rb#L311C1-L321C57
Metadata
Metadata
Assignees
Labels
No labels