Treat unmatched double quotes as literal path characters - #211
Open
xianjianlf2 wants to merge 1 commit into
Open
xianjianlf2 wants to merge 1 commit into
xianjianlf2 wants to merge 1 commit into
Conversation
Only enter quoted mode when an unescaped closing quote remains, so an unmatched quote does not disable following glob tokens. Assisted-by: OpenAI Codex (GPT-6 Astra, autonomous) Signed-off-by: MarkXian <mark-xian@foxmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A literal unmatched double quote in a filename starts quoted mode and causes later glob tokens to be treated as literal text:
Enter quoted mode only when an unescaped closing quote exists. An unmatched quote stays literal, allowing the following
*or?to work. Paired quotes keep their existing quoting behavior, and escaped quotes do not count as closing delimiters.This reproduces directly in picomatch 4.0.7 on macOS with Node 22.23.1. It also underlies fast-glob #494; the review of fast-glob #511 recommended addressing the matcher instead of a filesystem-layer workaround. This is a fresh implementation in the parser.
Validation: the new regression fails before the fix;
npm testpasses ESLint and all 1,999 tests. Regressions cover default options, disabled fast paths,keepQuotes, escaped closing quotes, and negative matches.AI assistance: OpenAI Codex (GPT-6 Astra) investigated, implemented, tested, and prepared this PR at the account owner's request. This was an autonomous agent contribution; no independent human review is claimed.