Launch with argument list to handle text as is #2737
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
tts-mode has a TODO comment about handling punctuation. This PR resolves the comment.
Discussion
The existing code strips all punctuation, then launches a process via shell by specifying a string. This is most likely done for security reasons as punctuation in a commandline string would allow shell control characters and thereby command execution.
This can be avoided by using the list invocation form instead. This PR does so and undoes the string processing as it's no longer needed.
One possible outstanding issue is how the executable customizable is handled. Before the change, a subshell does look up the executable, after the change it's handled directly by the
execv
equivalent. I'm not sure whether there's a difference in practice, but for cases like "espeak", it doesn't seem to make any.Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.