diff options
author | 2016-01-25 00:02:28 +0100 | |
---|---|---|
committer | 2016-01-25 00:14:13 +0100 | |
commit | 32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3 (patch) | |
tree | b4f10872f5182c8db7fa9629d1567e34e8373ef1 /sway | |
parent | swaybar: move headers to include/bar (diff) | |
download | sway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.tar.gz sway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.tar.zst sway-32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3.zip |
Add quotes to multiword arguments.
This adds quotes around multiword arguments before they are passed to
`/bin/sh -c` in an exec command.
Example:
I connect to irc like this:
exec termite -e "mosh server tmux a"
Without this patch the arguments are passed to sh as:
termite -e mosh server tmux a
When it should be:
termite -e "mosh server tmux a"
For the command to work.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 9f6e5032..ae5c48e6 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -361,8 +361,10 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
361 | return error; | 361 | return error; |
362 | } | 362 | } |
363 | 363 | ||
364 | add_quotes(argv + 1, argc - 1); | ||
364 | tmp = join_args(argv + 1, argc - 1); | 365 | tmp = join_args(argv + 1, argc - 1); |
365 | } else { | 366 | } else { |
367 | add_quotes(argv, argc); | ||
366 | tmp = join_args(argv, argc); | 368 | tmp = join_args(argv, argc); |
367 | } | 369 | } |
368 | 370 | ||