aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorChris Webb <chris@arachsys.com>2010-04-13 10:07:13 +0100
committerJunio C Hamano <gitster@pobox.com>2010-04-15 12:07:51 -0700
commitcb6a22c0760f30ff8050b508b9fabbe13ffba1ae (patch)
tree2a95e24b0a003dde2de39cbf70fcb22a1b4a9395 /git-compat-util.h
parentadda3c3beb0a244719becb1895e16227b0393bd1 (diff)
downloadgit-cb6a22c0760f30ff8050b508b9fabbe13ffba1ae.tar.gz
git-cb6a22c0760f30ff8050b508b9fabbe13ffba1ae.tar.xz
exec_cmd.c: replace hard-coded path list with one from <paths.h>
The default executable path list used by exec_cmd.c is hard-coded to be "/usr/local/bin:/usr/bin:/bin". Use an appropriate value for the system from <paths.h> when available. Add HAVE_PATHS_H make variables and enable it on Linux, FreeBSD, NetBSD, OpenBSD and GNU where it is known to exist for now. Somebody else may want to do an autoconf support later. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index a3c453736..e215ce0dd 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -163,6 +163,13 @@ extern char *gitbasename(char *);
#define PATH_SEP ':'
#endif
+#ifdef HAVE_PATHS_H
+#include <paths.h>
+#endif
+#ifndef _PATH_DEFPATH
+#define _PATH_DEFPATH "/usr/local/bin:/usr/bin:/bin"
+#endif
+
#ifndef STRIP_EXTENSION
#define STRIP_EXTENSION ""
#endif