Re: get_progname and .exe suffix

Andrew Dunstan <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>

Tom Lane wrote:

>Andrew Dunstan <[email protected]> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.