Re: [PATCH] Set up argv0_path correctly, even when argv[0] is just the basename

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Set up argv0_path correctly, even when argv[0] is just the basename

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:03

Johannes Schindelin [off-list ref] writes:
When the program 'git' is in the PATH, the argv[0] is set to the basename.
While it may be true, I do not think it matters that we cannot get the
full path _UNLESS_ we are doing the relative "../" business.  
However, argv0_path needs the full path, so add a function to discover the
program by traversing the PATH manually.
I think unconditionally requiring argv0_path to be set is the root cause
of the bug.  Unless we do not fix _that_, we will have to make a needless
call to lookup_program_in_path() even when nobody needs that information,
which is unacceptable.

Re: [PATCH] Set up argv0_path correctly, even when argv[0] is just the basename

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:45:03

Hi,

On Sat, 26 Jul 2008, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
However, argv0_path needs the full path, so add a function to discover 
the program by traversing the PATH manually.
I think unconditionally requiring argv0_path to be set is the root cause 
of the bug.  Unless we do not fix _that_, we will have to make a 
needless call to lookup_program_in_path() even when nobody needs that 
information, which is unacceptable.
Fair enough.  How about having a function called from system_path() which 
has a flag so it is run only once, and then calls lookup_program_in_path() 
provided that argv0_path contains no slashes _and_ exec_path is relative?

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help