X-Git-Url: http://git.scripts.mit.edu/?a=blobdiff_plain;f=run-command.c;h=3914d9c5117f29651b56772da143f0a226494a62;hb=8cd4249c4cdb19fce489a3f6ba31f499f4331341;hp=1b7f88eeb1f1971f1568d5991978192c2d00645e;hpb=b02f5aeda6f66ac3be9b2e35f9b237d4f1f80d73;p=git.git diff --git a/run-command.c b/run-command.c index 1b7f88eeb1..3914d9c511 100644 --- a/run-command.c +++ b/run-command.c @@ -406,13 +406,12 @@ int start_command(struct child_process *cmd) unsetenv(*cmd->env); } } - if (cmd->git_cmd) { + if (cmd->git_cmd) execv_git_cmd(cmd->argv); - } else if (cmd->use_shell) { + else if (cmd->use_shell) execv_shell_cmd(cmd->argv); - } else { + else sane_execvp(cmd->argv[0], (char *const*) cmd->argv); - } if (errno == ENOENT) { if (!cmd->silent_exec_failure) error("cannot run %s: %s", cmd->argv[0], @@ -446,7 +445,6 @@ int start_command(struct child_process *cmd) cmd->pid = -1; } close(notify_pipe[0]); - } #else { @@ -480,11 +478,10 @@ int start_command(struct child_process *cmd) if (cmd->env) env = make_augmented_environ(cmd->env); - if (cmd->git_cmd) { + if (cmd->git_cmd) cmd->argv = prepare_git_cmd(cmd->argv); - } else if (cmd->use_shell) { + else if (cmd->use_shell) cmd->argv = prepare_shell_cmd(cmd->argv); - } cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env, cmd->dir, fhin, fhout, fherr);