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>
This commit is contained in:

committed by
Junio C Hamano

parent
adda3c3beb
commit
cb6a22c076
@ -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
|
||||
|
Reference in New Issue
Block a user