Skip to content

fix: escape double quotes in POSIX paths - #526

Open
saitakarcesme wants to merge 1 commit into
mrmlnc:masterfrom
saitakarcesme:codex/escape-posix-double-quotes
Open

saitakarcesme wants to merge 1 commit into
mrmlnc:masterfrom
saitakarcesme:codex/escape-posix-double-quotes

Conversation

@saitakarcesme

Copy link
Copy Markdown

What is the purpose of this pull request?

Make posix.escapePath and posix.convertPathToPattern usable for directories containing double quotes. For example, posix.escapePath('"path') + '/*.txt' currently returns no files from "path, because the quote is left unescaped and interpreted by the glob parser.

Related to #494. This provides a fix through the path-escaping APIs; it does not change the interpretation of raw glob patterns.

What changes did you make? (Give an overview)

  • Escape POSIX double quotes and preserve already-escaped quotes.
  • Document the additional escaped character.
  • Add helper regression assertions and actual-filesystem tests covering leading, embedded, and paired quotes through sync, async, and stream APIs. Filesystem cases skip Windows because double quotes are invalid in Windows filenames.

Validation: five regressions failed before the fix. npm run build passes (TypeScript, ESLint, 281 unit tests); npm run test:e2e passes with 1,386 tests and 9 platform-dependent pending tests on macOS / Node 22.22.2.

AI-assisted implementation and testing.

@mergify

mergify Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@saitakarcesme

Copy link
Copy Markdown
Author

A quick follow-up: the CI, Benchmark and CodeQL workflow runs are still marked action_required. Could a maintainer approve the fork workflow runs when convenient so this change can be validated? Follow-up prepared with Codex assistance.

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.

1 participant