summaryrefslogtreecommitdiff
path: root/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/shell.c b/shell.c
index 5c67e7bd97..76333c8068 100644
--- a/shell.c
+++ b/shell.c
@@ -4,7 +4,6 @@
#include "strbuf.h"
#include "run-command.h"
#include "alias.h"
-#include "prompt.h"
#define COMMAND_DIR "git-shell-commands"
#define HELP_COMMAND COMMAND_DIR "/help"
@@ -144,6 +143,7 @@ static void run_shell(void)
}
free(argv);
+ free(split_args);
free(rawargs);
} while (!done);
}
@@ -217,9 +217,8 @@ int cmd_main(int argc, const char **argv)
count = split_cmdline(prog, &user_argv);
if (count >= 0) {
if (is_valid_cmd_name(user_argv[0])) {
- prog = make_cmd(user_argv[0]);
- user_argv[0] = prog;
- execv(user_argv[0], (char *const *) user_argv);
+ char *cmd = make_cmd(user_argv[0]);
+ execv(cmd, (char *const *) user_argv);
}
free(prog);
free(user_argv);