commands: handle quoted exec command

This commit is contained in:
Ian Fan 2018-08-11 00:52:53 +01:00
parent 453646b887
commit 69e00151bb

View file

@ -26,7 +26,16 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
return error; 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 { } else {
tmp = join_args(argv, argc); tmp = join_args(argv, argc);
} }