Merge pull request #519 from mikkeloscar/maintain-exec-quotes

Don't strip quotes from exec args
This commit is contained in:
Drew DeVault 2016-03-18 06:52:51 -04:00
commit 378a45cec2

View file

@ -362,10 +362,8 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) {
return error; return error;
} }
add_quotes(argv + 1, argc - 1);
tmp = join_args(argv + 1, argc - 1); tmp = join_args(argv + 1, argc - 1);
} else { } else {
add_quotes(argv, argc);
tmp = join_args(argv, argc); tmp = join_args(argv, argc);
} }
@ -2869,12 +2867,14 @@ struct cmd_results *handle_command(char *_exec) {
//TODO better handling of argv //TODO better handling of argv
int argc; int argc;
char **argv = split_args(cmd, &argc); char **argv = split_args(cmd, &argc);
if (strcmp(argv[0], "exec") != 0) {
int i; int i;
for (i = 1; i < argc; ++i) { for (i = 1; i < argc; ++i) {
if (*argv[i] == '\"' || *argv[i] == '\'') { if (*argv[i] == '\"' || *argv[i] == '\'') {
strip_quotes(argv[i]); strip_quotes(argv[i]);
} }
} }
}
struct cmd_handler *handler = find_handler(argv[0], CMD_BLOCK_END); struct cmd_handler *handler = find_handler(argv[0], CMD_BLOCK_END);
if (!handler) { if (!handler) {
if (results) { if (results) {