Skip to content

Write Windows paths with single backslashes, escape only where read - #34

Merged
geeooff merged 1 commit into
mainfrom
backslashes
Nov 16, 2026
Merged

geeooff merged 1 commit into
mainfrom
backslashes

Conversation

@geeooff

@geeooff geeooff commented Nov 16, 2026

Copy link
Copy Markdown
Owner

The log doubled every backslash of a path in its details, for example program="C:\Users\..." and task="GameModeExecutor\Watcher". The cause was central: the formatter wrote text fields with Debug.

  • The log: text fields are quoted as written, and a command's arguments read as typed (/Run /TN "GameModeExecutor\FanControl Game"). Two tests pin this.
  • The code: the paths and registry keys still written with "\\" become raw strings, nine in all.
  • Where a reader does escape \, one function does it:
    • build.rs writes rc.exe's script from a raw template, and passes every value through rc_string (backslashes and quotes). Before, only the icon path was escaped.
    • shell::quoted (PowerShell) and JSON were already right.
  • AGENTS.md says which readers escape, so nothing is doubled out of caution again.
  • The changelog has a Fixed line.

.\scripts\build.ps1 test passes, and the release build embeds the same version resources as before.

🤖 Generated with Claude Code

The log's formatter wrote every text field with Debug, which doubled each
backslash of a path (program="C:\Users\..."): text fields are now quoted
as written, and a command's arguments are shown as typed instead of as a
Debug list. In the code, the paths and registry keys still written with
"\\" become raw strings.

Where a reader does take `\` as an escape, one function does it: build.rs
writes rc.exe's script from a raw template and passes every value through
rc_string, which escapes backslashes and quotes, where only the icon path
was escaped before. shell::quoted for PowerShell and JSON's own rules were
already right. AGENTS.md now says which readers escape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@geeooff
geeooff enabled auto-merge November 16, 2026 16:28
@geeooff
geeooff merged commit 9dec191 into main Nov 16, 2026
2 checks passed
@geeooff
geeooff deleted the backslashes branch November 16, 2026 16:41
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