Description
When passing a path that contains spaces on Windows, the shell requires quoting. Tab-completion in PowerShell automatically appends a trailing backslash to directory paths, producing a form like:
rsgain easy "C:\Users\Joffrey\Music\A Feast For Kings\"
This triggers a Windows argument parsing quirk: CommandLineToArgvW treats \" as a literal " rather than the closing delimiter of the quoted argument. As a result, argv receives the path with a trailing " instead of \:
[FAILURE] Directory 'C:\Users\Joffrey\Music\A Feast For Kings"' does not exist
The same issue occurs with single quotes in PowerShell, since PowerShell still builds the same underlying Windows process command line.
Steps to reproduce
- Have a directory with a space in its name
- Run
rsgain easy "C:\path\to\My Folder\" (trailing backslash before closing quote)
Expected: rsgain processes the directory
Actual: [FAILURE] Directory '...' does not exist with a stray " at the end of the path
Affects both easy mode (directory argument) and custom mode (file path arguments).
Description
When passing a path that contains spaces on Windows, the shell requires quoting. Tab-completion in PowerShell automatically appends a trailing backslash to directory paths, producing a form like:
This triggers a Windows argument parsing quirk:
CommandLineToArgvWtreats\"as a literal"rather than the closing delimiter of the quoted argument. As a result,argvreceives the path with a trailing"instead of\:The same issue occurs with single quotes in PowerShell, since PowerShell still builds the same underlying Windows process command line.
Steps to reproduce
rsgain easy "C:\path\to\My Folder\"(trailing backslash before closing quote)Expected: rsgain processes the directory
Actual:
[FAILURE] Directory '...' does not existwith a stray"at the end of the pathAffects both easy mode (directory argument) and custom mode (file path arguments).