From 69e00151bbd5c2648194b538ad80aba1d305d24a Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sat, 11 Aug 2018 00:52:53 +0100 Subject: [PATCH] commands: handle quoted exec command --- sway/commands/exec_always.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 00e39ae70..5ce7919b4 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -26,7 +26,16 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { return error; } - tmp = join_args(argv + 1, argc - 1); + --argc; ++argv; + } + + if (argv[0][0] == '\'' || argv[0][0] == '"') { + if (argc > 0) { + return cmd_results_new(CMD_INVALID, "exec_always", + "command cannot be partially quoted"); + } + tmp = strdup(argv[0]); + strip_quotes(tmp); } else { tmp = join_args(argv, argc); }