src/port/getopt_long.c lossy with arguments having no option characters

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: src/port/getopt_long.c lossy with arguments having no option characters
Date: 2015-04-03 02:44:40
Message-ID: CAB7nPqQ45JbD1ZBvbD7gqQK4diGZXmGw56zp7R_DvEKO8EdMbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi all,

The implementation of getopt_long in src/port has some limitations,
for example such commands do not work but they should:
$ createdb foobar3 -E win1252
createdb: too many command-line arguments (first is "win1252")
Try "createdb --help" for more information.
$ initdb pgdata --noclean
initdb: too many command-line arguments (first is "--noclean")
Try "initdb --help" for more information.

And those ones work:
createdb -E win1252 foobar3
initdb --noclean pgdata

I bumped into this problem when running the TAP tests on Windows, but
I guess that it easy to reproduce it with any builds of Postgres on
Windows as getopt_long is used unconditionally, on any version, for
all commands. Or on any platform that has not getopt_long, if any
exists.
Regards,
--
Michael

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Slavov 2015-04-03 09:47:20 Re: BUG #12910: Memory leak with logical decoding
Previous Message robert.uradin 2015-04-02 20:36:36 BUG #12950: Update problem