aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/exec_always.c
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-08-11 00:52:53 +0100
committerIan Fan <ianfan0@gmail.com>2018-08-18 15:50:26 +0100
commit69e00151bbd5c2648194b538ad80aba1d305d24a (patch)
treecb110a8c5b7c6da3b82490cb5224877b45edd793 /sway/commands/exec_always.c
parent453646b88798f4835a4c82cac103c801ddde4818 (diff)
commands: handle quoted exec command
Diffstat (limited to 'sway/commands/exec_always.c')
-rw-r--r--sway/commands/exec_always.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 00e39ae7..5ce7919b 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);
}