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

Re: getopt() and strdup()

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: getopt() and strdup()
Date: 2012-10-08 19:53:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On 10/08/2012 02:40 PM, Bruce Momjian wrote:
> A while ago I noticed that in some places we strdup/pg_strdup() optarg
> strings from getopt(), and in some places we don't.
> If we needed the strdup(), the missing cases should generate errors.  If
> we don't need them, the strdup() is unnecessary, and research confirms
> they are unnecessary.  Should we remove the extra strdup/pg_strdup()
> calls, for consistency.
> I think we might have had old platforms that required it, but none are
> still supported today.

ISTR there was a requirement at least on some platforms to use 
strdup/pg_strdup if the individual argument could be deformed, or the 
argument vector could be deformed. But maybe my memory is astray.

I'm all for consistency, but only if we're darn sure it's not going to 
break things.



In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-10-08 20:00:27
Subject: Re: Add FET to Default and Europe.txt
Previous:From: Kohei KaiGaiDate: 2012-10-08 19:49:24
Subject: Re: [v9.3] Row-Level Security

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