Skip site navigation (1) Skip section navigation (2)

Re: get_progname and .exe suffix

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: get_progname and .exe suffix
Date: 2004-10-16 16:57:26
Message-ID: 8650.1097945846@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers-win32
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Tom Lane wrote:
>> What would break if we caused get_progname itself to strip the suffix?

> 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.

Seems reasonable.  What I was more worried about though was whether
there are any callers that actually need a non-stripped result.

			regards, tom lane

In response to

Responses

pgsql-hackers-win32 by date

Next:From: Andrew DunstanDate: 2004-10-16 19:37:36
Subject: Re: get_progname and .exe suffix
Previous:From: Andrew DunstanDate: 2004-10-16 16:35:41
Subject: Re: get_progname and .exe suffix

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group