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

On Windows, using a path to locate an app doesn't work if the path has spaces in it. #85

Closed
xalbd opened this issue Nov 22, 2023 · 2 comments

Comments

@xalbd
Copy link
Contributor

xalbd commented Nov 22, 2023

Let's attempt to open a file C:\file.jpg using the program C:\Program Files\Google\Chrome\Application\chrome.exe.

open::with("C:\\file.jpg", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe").unwrap();

This results in an error as Windows says it cannot find C:\Program. This seems to be caused by the same issue that was addressed for file paths in #53.

open-rs/src/windows.rs

Lines 25 to 26 in a33caba

.raw_arg(app.into())
.raw_arg(wrap_in_quotes(path))

A simple fix would be to call the same wrap_into_quotes on app. I just tested this fix in a fork and it works; let me know if you'd like me to open a PR.

This issue was originally discovered here: typst/typst#2724

@Byron
Copy link
Owner

Byron commented Nov 22, 2023

Thanks so much for letting me know and offering a fix - a PR would be greatly appreciated.

@xalbd
Copy link
Contributor Author

xalbd commented Nov 22, 2023

Awesome! Just created PR #86. Thanks for the quick response!

Byron added a commit that referenced this issue Nov 22, 2023
@xalbd xalbd closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants