Skip to content

fix: don't treat closing quote as escaped after an escaped backslash#262

Open
SAY-5 wants to merge 1 commit into
joho:mainfrom
SAY-5:fix/escaped-backslash-quote
Open

fix: don't treat closing quote as escaped after an escaped backslash#262
SAY-5 wants to merge 1 commit into
joho:mainfrom
SAY-5:fix/escaped-backslash-quote

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 13, 2026

When scanning for a quoted value's terminator, a closing quote was skipped whenever the preceding byte was a backslash, even if that backslash was itself escaped, so FOO="bar\\" failed with "unterminated quoted value". The quote is now considered escaped only when preceded by an odd number of backslashes, matching the behaviour of the reference dotenv parsers. Closes #225

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.

extractVarValue assumes a quote is escaped if a backslash precedes it, even if the backslash is escaped

1 participant