Re: [PATCH] Fallback on _NSGetExecutablePath to get the executable path if using argv[0] fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 29, 2010 at 2:57 PM, Jeremy Huddleston <jeremyhu@xxxxxxxxx> wrote:
>
> Signed-off-by: Jeremy Huddleston <jeremyhu@xxxxxxxxx>
> Reviewed-by: Matt Wright <mww@xxxxxxxxx>
> ---
> Âexec_cmd.c | Â 17 +++++++++++++++++
> Â1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/exec_cmd.c b/exec_cmd.c
> index bf22570..1e24a8f 100644
> --- a/exec_cmd.c
> +++ b/exec_cmd.c
> @@ -3,6 +3,10 @@
> Â#include "quote.h"
> Â#define MAX_ARGS Â Â Â 32
>
> +#if defined(__APPLE__) && defined(RUNTIME_PREFIX)
> +#include <mach-o/dyld.h>
> +#endif
> +
> Âextern char **environ;
> Âstatic const char *argv_exec_path;
> Âstatic const char *argv0_path;
> @@ -53,6 +57,19 @@ const char *git_extract_argv0_path(const char *argv0)
> Â Â Â Âif (slash >= argv0) {
> Â Â Â Â Â Â Â Âargv0_path = xstrndup(argv0, slash - argv0);
> Â Â Â Â Â Â Â Âreturn slash + 1;
> +#ifdef __APPLE__

Why not #if defined(__APPLE__), like above?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]