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

Fix logic error in macro file reader #1606

Merged
merged 1 commit into from Mar 26, 2021

Conversation

mlschroe
Copy link
Contributor

The old logic always finished adding lines if an empty line
was encountered, because the check that should guard against
accessing outside of the read buffer was done at the wrong
level.

Also simplify the code by letting 'q' point to the new line and
not before the newline, which also fixes potential undefined
behaviour.

Also get rid of the unused 'nread' variable.

The old logic always finished adding lines if an empty line
was encountered, because the check that should guard against
accessing outside of the read buffer was done at the wrong
level.

Also simplify the code by letting 'q' point to the new line and
not before the newline, which also fixes potential undefined
behaviour.

Also get rid of the unused 'nread' variable.
@pmatilai
Copy link
Member

Oh, nice. Besides fixing a concrete parser bug (there actually is even an RFE to support those empty lines, #580) it gets rid of the shady code as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants