From: Erik Faye-Lund Date: Wed, 07 Apr 2010 10:57:37 GMT Subject: Re: [PATCH] Replace hard-coded path with one from Message-ID: In-Reply-To: <20100406163643.GG15306@arachsys.com> On Tue, Apr 6, 2010 at 6:36 PM, Chris Webb wrote: > In exec_cmd.c, git hard-codes a default path of /usr/local/bin:/usr/bin:/bin. > Get an appropriate value for the system from if possible instead. > > Signed-off-by: Chris Webb > --- >  exec_cmd.c        |    2 +- >  git-compat-util.h |    5 +++++ >  2 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/exec_cmd.c b/exec_cmd.c > index b2c07c7..bf22570 100644 > --- a/exec_cmd.c > +++ b/exec_cmd.c > @@ -107,7 +107,7 @@ void setup_path(void) >        if (old_path) >                strbuf_addstr(&new_path, old_path); >        else > -               strbuf_addstr(&new_path, "/usr/local/bin:/usr/bin:/bin"); > +               strbuf_addstr(&new_path, _PATH_DEFPATH); > >        setenv("PATH", new_path.buf, 1); > > diff --git a/git-compat-util.h b/git-compat-util.h > index 7e62b55..7592be7 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -92,6 +92,7 @@ >  #include >  #include >  #include > +#include This breaks on Windows due to missing paths.h. I guess you need some guard to detect if the header is present or not. -- Erik "kusma" Faye-Lund