pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix our getopt_long's behavior for a command line argument of ju 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/980a70b9763e330dab6d0eb994c96a007876e40e Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/036fdf6be2ebc6cddd045ba83efdc62810b84483 Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/aae7e8530dac411fe4d9021e2392917458b37f8d Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ef7d6d79af43b168caf3ecc5847dcf47032b2253 Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c0eb57dd989b7f4c2faf486a39c83dd8a4ae4189 Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix our getopt_long's behavior for a command line argument of ju @ 2020-03-23 15:58 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-23 15:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix our getopt_long's behavior for a command line argument of just "-". src/port/getopt_long.c failed on such an argument, always seeing it as an unrecognized switch. This is unhelpful; better is to treat such an item as a non-switch argument. That behavior is what we find in GNU's getopt_long(); it's what src/port/getopt.c does; and it is required by POSIX for getopt(), which getopt_long() ought to be generally a superset of. Moreover, it's expected by ecpg, which intends an argument of "-" to mean "read from stdin". So fix it. Also add some documentation about ecpg's behavior in this area, since that was miserably underdocumented. I had to reverse-engineer it from the code. Per bug #16304 from James Gray. Back-patch to all supported branches, since this has been broken forever. Discussion: https://postgr.es/m/16304-c662b00a1322db7f@postgresql.org Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5f9eace5db4ef9d020aef44f972cea627b663932 Modified Files -------------- doc/src/sgml/ref/ecpg-ref.sgml | 31 ++++++++++++++++++++++++++----- src/port/getopt_long.c | 14 +++++++++++--- 2 files changed, 37 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2020-03-23 15:58 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us> 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us> 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us> 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us> 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us> 2020-03-23 15:58 pgsql: Fix our getopt_long's behavior for a command line argument of ju Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox