Fix AbstractInputStream#gets to not assume a_sep_string will appear…#662
Open
ListlessPanda wants to merge 1 commit intorubyzip:2.3from
Open
Conversation
… within the bytes that are being limited by `number_of_bytes`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
AbstractInputStream#getshas logic to check if the number of bytes within the@output_bufferare over the limit then setsover_limit. It seems that if a separator was passed in along with the number of bytes the code assumes the separator will appear within the bytes read.This was picked up when streaming a CSV out of a ZIP where the CSV passes the
a_sep_stringas\nand the number of bytes as8192and the file contains a single column value that is longer than8192bytesI made a change that if the separator wasn't found and we are above the limit it will return up to the number of bytes and increase the
@posby that amount.(This is my first pull request please let me know if I need to do anything else)