Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EditorSelectionGui requires quote marks for program paths containing spaces #22

Open
Lexikos opened this issue Dec 15, 2024 · 0 comments

Comments

@Lexikos
Copy link
Contributor

Lexikos commented Dec 15, 2024

As reported in https://www.autohotkey.com/boards/viewtopic.php?f=60&t=132503

If the program path contains spaces and is not quoted, CmdChanged fails to validate the command line and does not enable the OK button. This is because CommandLineToArgvW requires each component to be quoted (i.e. it is a string of args, not a command line), whereas CreateProcess permits the program name to contain spaces even if it is not quoted; e.g. C:\Program Files\A\B.exe "%1" can run C:\Program.exe or C:\Program Files\A\B.exe depending on what exists.

When the initial portion is not quoted, CmdChanged should test each space-terminated prefix (appending .exe if no extension is present) until the program is found, then update the command line to quote the program name, and enable the OK button.

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

No branches or pull requests

1 participant