mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #2537 from ianyfan/commands
commands: fix exec quoting
This commit is contained in:
commit
de9e80459a
1 changed files with 4 additions and 9 deletions
|
@ -21,20 +21,15 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
|
|||
}
|
||||
|
||||
char *tmp = NULL;
|
||||
if (strcmp((char*)*argv, "--no-startup-id") == 0) {
|
||||
if (strcmp(argv[0], "--no-startup-id") == 0) {
|
||||
wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored.");
|
||||
if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) {
|
||||
--argc; ++argv;
|
||||
if ((error = checkarg(argc, "exec_always", EXPECTED_MORE_THAN, 0))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
--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");
|
||||
}
|
||||
if (argc == 1 && (argv[0][0] == '\'' || argv[0][0] == '"')) {
|
||||
tmp = strdup(argv[0]);
|
||||
strip_quotes(tmp);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue