Re: Call for objections: deprecate postmaster -o switch?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Call for objections: deprecate postmaster -o switch?
Date: 2001-11-26 01:04:27
Message-ID: 7172.1006736667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> No it's not, unfortunately. BSD versions of getopt, including the one we
> ship as replacement, have a bug that considers any argument that starts
> with '--' to be equivalent with '--' (which means end of options).

I believe we could trivially fix our substitute version: at line 74 of
src/utils/getopt.c,

if (place[1] && *++place == '-')

should be

if (place[1] && *++place == '-' && place[1] == '\0')

It might still not work on older BSDen, but there's no reason it
shouldn't work on platforms where we use our own code.

A slightly more aggressive answer would be to use our own code always,
or to test for brokenness of the system getopt in configure and use our
own code if so.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-11-26 01:44:34 Re: Call for objections: deprecate postmaster -o switch?
Previous Message Tom Lane 2001-11-26 00:55:30 Re: Call for objections: deprecate postmaster -o switch?