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 bug in readQuotedString: recognize leading escaped character #10

Merged
merged 2 commits into from
Mar 31, 2019

Conversation

mathisgerdes
Copy link
Contributor

The implementation of readQuotedString only checks for a \ after the first character (after the while check nextChar != ", the next character is immediately added). If the quoted string starts like \"some text..., this leads to unexpected behavior: the backslash is added and the subsequent " terminates the string.

I have fixed this and added an appropriate test. The implementation should also be cleaner now.

My apologies for not getting this right in the first place; I must have been too tired when I first implemented this.

mathisgerdes and others added 2 commits March 31, 2019 18:43
First character of a quoted string may be an escaped character,
as in "\"A special name\"". The previous implementation only checks
for backslash after the first character.
@michaelspiss
Copy link
Owner

Oh, I also completely missed this case. Thank you for the fix!

@michaelspiss michaelspiss merged commit ae502a2 into michaelspiss:develop Mar 31, 2019
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