Re: get_progname and .exe suffix

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: get_progname and .exe suffix
Date: 2004-10-16 16:35:41
Message-ID: 41714DDD.4080007@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2004-10-16 16:57:26 Re: get_progname and .exe suffix
Previous Message Tom Lane 2004-10-16 16:24:00 Re: get_progname and .exe suffix