Skip to content

dired-open-xdg: file path could contain quotes. use call-process. #225

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ika-twb
Copy link

@ika-twb ika-twb commented Oct 28, 2024

In dired-open-xdg, the shell command is constructed using concat to be run by call-process-shell-command, and file path as an argument is surrounded by single quotes ' to prevent most special characters being parsed as such except single quote itself.
Thus, if the file contains single quotes anywhere in the path, dired-open-xdg would fail to open it as the shell would not consider the path as a whole word.
Using call-process would pass ARGS, in this case the file path, straight to the program as a whole, eliminating the issue of quotes as well as other shell special characters.

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