git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 29, 2010, 20:19 UTC
Message-ID
<20101129201958.GA10334@burratino>
In-Reply-To
<BED9E026-6804-4ABF-A26D-8F20699BAD0B@apple.com>
Jeremy Huddleston wrote:
> On Nov 29, 2010, at 13:50, Jonathan Nieder wrote:
>> Jeremy Huddleston wrote:
>>> On Nov 29, 2010, at 12:12, Jonathan Nieder wrote:
Show 12 quoted lines
>>>> The section "2) #ifdefs are ugly" of
>>>> linux-2.6/Documentation/SubmittingPatches explains the rationale.
>>> 
>>> I agree, but I don't really see a way around it here since this API is specific to OS X.
>> 
>> Did you actually read that section? :)
>
> Yes, but I don't have the time to "do it right" right now ... I'm
> contributing the patch that we are using back to the community in
> the spirit of OSS development, but I don't have the time resources
> currently to "do it right" at present.  I'll come back to it once
> time allows if nobody else picks it up.
Okay.  Thanks for reporting.

My guess is that the Windows version could be simplified, too, if we introduce a function to get the path to the binary. On Linux it should use "readlink /proc/$$/exe", on Darwin the function you pointed to, on Win32 _pgmptr, as a fallback look for argv[0] in $PATH if someone on another platform is interested.

Jonathan
Previous: Jeremy HuddlestonNext: Kevin Ballard
Message 11 of 14 in “Fallback on _NSGetExecutablePath to get the executable path if using argv[0] fails”
  1. Fallback on _NSGetExecutablePath to get the executable path if using argv[0] failsJeremy Huddleston, Nov 29, 2010
  2. Thiago FarinaNov 29, 2010
  3. Jonathan NiederNov 29, 2010
  4. Fallback on _NSGetExecutablePath to get the executable path if using argv[0] failsJeremy Huddleston, Nov 29, 2010
  5. Jonathan NiederNov 29, 2010
  6. Junio C HamanoNov 29, 2010
  7. Jeremy HuddlestonNov 29, 2010
  8. Jeremy HuddlestonNov 29, 2010
  9. Jonathan NiederNov 29, 2010
  10. Jeremy HuddlestonNov 29, 2010
  11. Jonathan NiederNov 29, 2010
  12. Kevin BallardNov 29, 2010
  13. Jonathan NiederDec 3, 2010
  14. Kevin BallardDec 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.