Skip to content

Conversation

inejge
Copy link

@inejge inejge commented Sep 19, 2024

The two commits in this PR fix a) recognizing an escaped backslash as valid in a string, b) overeager stripping of double quotes from a grammar-recognized string, which would result in a final escaped double quote to be removed, resulting in an invalid escape sequence.

Fixes #217

An escaped double quote is recognized by the grammar, but when
it's the last character in the string, trim_matches() would
strip it along with the final delimiter, leaving a bare backslash
at the end and resulting in an invalid escape sequence.

The fix uses strip_{prefix,suffix}() to remove the quotes, relying
on the grammar to deliver a correctly delimited string.
@jgarzik
Copy link
Contributor

jgarzik commented Sep 19, 2024

Superceded by #222

@jgarzik jgarzik closed this Sep 19, 2024
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.

[awk]: fails to recognize some escape sequences in strings
2 participants