ecpg -? option doesn't work in windows

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: ecpg -? option doesn't work in windows
Date: 2016-08-29 06:10:00
Message-ID: CAJrrPGfnRXvmCzxq6Dy=stAWebfNHxiL+Y_z7uqksZUCkW_waQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ecpg option --help alternative -? doesn't work in windows.
In windows, the PG provided getopt_long function is used
for reading the provided options.

The getopt_long function returns '?' for invalid characters
also but it sets optopt option to 0 in case if the character
itself is a '?'. But this works for Linux and others, whereas
for windows, optopt is not 0. Because of this reason it is
failing.

I feel, from this commit 5b88b85c on wards, it is not working.
I feel instead of fixing the getopt_long function to reset optopt
parameter to zero whenever it is returning '?', I prefer fixing
the ecpg in handling the version and help options seperate.

Patch is attached. Any one prefers the getopt_long function
fix, I can produce the patch for the same.

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
ecpg_bugfix.patch application/octet-stream 2.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-08-29 06:30:17 Re: Renaming of pg_xlog and pg_clog
Previous Message Andrew Borodin 2016-08-29 06:04:49 GiST penalty functions [PoC]