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 escapingio handling of \n~\n #8798

Merged
merged 3 commits into from
Sep 1, 2020
Merged

Fix escapingio handling of \n~\n #8798

merged 3 commits into from
Sep 1, 2020

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Sep 1, 2020

The escapingio reader detects new lines followed by an escaping char \n~, but apparently if the escape char is followed by another new line, the reader ignores this read line and looks for another new line. This results into the reader not handling \n~\n~. .

This PR fixes the bug, by ensuring that if \n follows a ~, we emit the text and set parser state to sLookEscapeChar.

The TestEscapingReader_Static fails in the first commit in
https://app.circleci.com/pipelines/github/hashicorp/nomad/11526/workflows/c6193ea7-18a9-439c-8f93-6810845ce224/jobs/96780/tests but succeeds after applying the logic change.

Fixes #8736 .

@notnoop notnoop requested a review from tgross September 1, 2020 01:16
@notnoop notnoop self-assigned this Sep 1, 2020
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

[ci skip]
@notnoop notnoop merged commit 81f9c0d into master Sep 1, 2020
@notnoop notnoop deleted the b-esccaping-newline branch September 1, 2020 14:00
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

escapingio reader test failure
2 participants