Re: why was the VAR 'optind' never changed in initdb?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: why was the VAR 'optind' never changed in initdb?
Дата
Msg-id CA+TgmoZwD9QacF2_gM0rjxj2m6AdArnEhkvr5C5vB3Jp30UqJw@mail.gmail.com
обсуждение исходный текст
Ответ на why was the VAR 'optind' never changed in initdb?  (Clover White <mywhiteclover@gmail.com>)
Ответы Re: why was the VAR 'optind' never changed in initdb?  (Clover White <mywhiteclover@gmail.com>)
Список pgsql-hackers
On Mon, Apr 9, 2012 at 7:38 AM, Clover White <mywhiteclover@gmail.com> wrote:
> Hi,
>   I'm debugging initdb using gdb.
>   I found that I could not step in the function getopt_long in line 2572 in
> initdb.c.
>   I also found that the value of VAR optind never be changed. VAR optind is
> always equal to 1 but how could optind be larger than the value of argc(the
> value of argc is 6) in line 2648 and 2654.

Read the man page for getopt_long.  It changes the global variable optind.

It's a silly interface, but also a long and hallowed UNIX tradition,
so we're stuck with it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Last gasp
Следующее
От: Andres Freund
Дата:
Сообщение: Deprecating non-select rules (was Re: Last gasp)