Skip to content

ninja_syntax: escape paths in Writer.default - #2837

Merged
jhasse merged 1 commit into
ninja-build:masterfrom
r3wretrhy:fix-default-escape-path-spaces
Oct 9, 2026
Merged

jhasse merged 1 commit into
ninja-build:masterfrom
r3wretrhy:fix-default-escape-path-spaces

Conversation

@r3wretrhy

Copy link
Copy Markdown
Contributor

Writer.build already runs escape_path on outputs and inputs, but Writer.default joined paths raw. A single default target with a space was therefore emitted as two defaults.

Use escape_path for each path, matching the rest of the Writer API. Suggested on #990 (and in closed #1067).

The added tests fail on the unpatched helper (default foo bar with a space) and pass with this change.

python3 -m pytest misc/ninja_syntax_test.py -q
# 28 passed

Writer.build already runs escape_path on outputs and inputs, but
Writer.default joined paths raw. A single default target with a space
was therefore emitted as two defaults.

Use escape_path for each path, matching the rest of the Writer API.
@jhasse
jhasse merged commit c2817e5 into ninja-build:master Oct 9, 2026
17 checks passed
@jhasse jhasse added this to the 1.14.0 milestone Oct 9, 2026
jhasse added a commit to jhasse/cja that referenced this pull request Oct 9, 2026
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.

2 participants