Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly parse BCCs that correspond to the newline character #24

Merged
merged 1 commit into from
Apr 10, 2021

Conversation

weltenwort
Copy link
Owner

Summary

This fixes a parsing bug which occurs when the block check character of the data message happens to be the newline character.

Background

The previously used regex for the BCC . doesn't normally match newlines while the end-of-line character $ matches before the newline. This lead to the situation that the BCC was not recognized as such when its byte value happened to correspond to the newline character. Instead, the $ would match it and the resulting message would fail parsing due to a lack of a BCC.

After this change the \A and \Z characters as replacements for ^ and $ in combination with the DOTALL flag lead to correct parsing behavior.

@weltenwort weltenwort added bug Something isn't working patch version This change warrants a patch release labels Apr 10, 2021
@weltenwort weltenwort self-assigned this Apr 10, 2021
@weltenwort weltenwort merged commit 5cc5ea2 into main Apr 10, 2021
@weltenwort weltenwort deleted the fix-newline-block-check-character branch April 10, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch version This change warrants a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant