From 32ae26e519eeb6a5108f1d82fe36ce5b6ef65af3 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Mon, 25 Jan 2016 00:02:28 +0100 Subject: 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. --- sway/commands.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sway/commands.c') 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) { return error; } + add_quotes(argv + 1, argc - 1); tmp = join_args(argv + 1, argc - 1); } else { + add_quotes(argv, argc); tmp = join_args(argv, argc); } -- cgit v1.2.3