Scripts: smoke.ps1 corrupts -Game paths that end with a trailing backslash #16

Open
opened 2026-11-27 05:55:46 +00:00 by github-bot · 0 comments
Owner

@⁠ArpitK24 on GitHub · 2026-11-27 05:54 UTC · original

In scripts/smoke.ps1, the emulator arguments are built as:

$psi.Arguments = 'run "' + $Game + '"'

On Windows, if -Game has a trailing backslash (e.g. D:\Games\MyTitle\ from PowerShell tab-completion), \" at the end is parsed by CommandLineToArgvW / Rust std::env::args() as an escaped literal quote, corrupting the path passed to XSEmu.exe.

Plan:

  • Escape embedded quotes and double trailing backslashes in $Game before wrapping it in quotes in scripts/smoke.ps1.
  • Add a PowerShell test (scripts/test-smoke-args.tests.ps1) verifying that a -Game path with spaces and a trailing backslash is received intact by a native console executable.
**@⁠ArpitK24** on GitHub · 2026-11-27 05:54 UTC · [original](https://github.com/zortos293/XSEmu/issues/16) In `scripts/smoke.ps1`, the emulator arguments are built as: ```powershell $psi.Arguments = 'run "' + $Game + '"' ``` On Windows, if `-Game` has a trailing backslash (e.g. `D:\Games\MyTitle\` from PowerShell tab-completion), `\"` at the end is parsed by `CommandLineToArgvW` / Rust `std::env::args()` as an escaped literal quote, corrupting the path passed to `XSEmu.exe`. **Plan:** - Escape embedded quotes and double trailing backslashes in `$Game` before wrapping it in quotes in `scripts/smoke.ps1`. - Add a PowerShell test (`scripts/test-smoke-args.tests.ps1`) verifying that a `-Game` path with spaces and a trailing backslash is received intact by a native console executable.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 05:55:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/zortos293--XSEmu#16
No description provided.