@matheusbsbs / matheus-bagliano / commits / e8f5d87056
Fork 0

shell should call the new setup_path() to setup $PATH

Shell currently does its own manual thing for setting up the $PATH; it can now call setup_path(). Signed-off-by: Scott R Parish <srp@srparish.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Scott R Parish committed Oct 27, 2007 at 01:36 UTC e8f5d87056093f40a271f89c2c91d1a7025e2440
1 file changed +1 -7
shell.c
+1 -7
@@ -24,17 +24,11 @@ static int do_cvs_cmd(const char *me, char *arg)
24 const char *cvsserver_argv[3] = {
25 "cvsserver", "server", NULL
26 };
27 - const char *oldpath = getenv("PATH");
28 - struct strbuf newpath = STRBUF_INIT;
27
28 if (!arg || strcmp(arg, "server"))
29 die("git-cvsserver only handles server: %s", arg);
30
33 - strbuf_addstr(&newpath, git_exec_path());
34 - strbuf_addch(&newpath, ':');
35 - strbuf_addstr(&newpath, oldpath);
36 -
37 - setenv("PATH", strbuf_detach(&newpath, NULL), 1);
31 + setup_path(NULL);
32
33 return execv_git_cmd(cvsserver_argv);
34 }