Fixed parsing of boundary patches from binary format #51
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.
Since the end of boundary patches in binary file was checked by stripping the line and checking if the result was equal to '}' it was possible that the end of a patch was miss-detected, since a '}' surrounded by characters that are removed by the strip function could appear randomly in the binary content (and indeed happened in my case ).
I updated the check to remove only withe spaces, tabs and new lines in the stripping operation and check for the ');' characters at the end of the previous line to determine if the actual end of the boundary patch is reached.
I think its theoretically possible that the end of a patch is still miss-detected (since a ');' followed on the next line by a '}' surrounded by tabs or withe-spaces could still appear randomly in the binary content) but it's much more unlikely.