Re: get_progname and .exe suffix - Mailing list pgsql-hackers-win32

From Andrew Dunstan
Subject Re: get_progname and .exe suffix
Date
Msg-id 41714DDD.4080007@dunslane.net
Whole thread Raw
In response to Re: get_progname and .exe suffix  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: get_progname and .exe suffix  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers-win32

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>I posted on -hackers the other day about get_progname returning a name
>>with the .exe suffix.
>>
>>
>
>What would break if we caused get_progname itself to strip the suffix?
>That would be a nice localized fix if it worked ...
>
>

Yes. get_progname() actually just returns a pointer to one past the last
directory separator it finds in its argument string. Having it strip the
.exe directly would in effect involve mangling argv[0]. That's what
makes me slightly nervous about it. We could have it strdup() the result
and then mangle that - note that it is called by postmaster before we
set up any memory context stuff.


cheers

andrew

pgsql-hackers-win32 by date:

Previous
From: Tom Lane
Date:
Subject: Re: get_progname and .exe suffix
Next
From: Tom Lane
Date:
Subject: Re: get_progname and .exe suffix