https://github.com/postgres/postgres
Revision 5f9eace5db4ef9d020aef44f972cea627b663932 authored by Tom Lane on 23 March 2020, 15:58:01 UTC, committed by Tom Lane on 23 March 2020, 15:58:01 UTC
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
1 parent 87d0f48
History
Tip revision: 5f9eace5db4ef9d020aef44f972cea627b663932 authored by Tom Lane on 23 March 2020, 15:58:01 UTC
Fix our getopt_long's behavior for a command line argument of just "-".
Tip revision: 5f9eace
File Mode Size
config
contrib
doc
src
.dir-locals.el -rw-r--r-- 738 bytes
.gitattributes -rw-r--r-- 1.7 KB
.gitignore -rw-r--r-- 428 bytes
COPYRIGHT -rw-r--r-- 1.2 KB
GNUmakefile.in -rw-r--r-- 3.6 KB
HISTORY -rw-r--r-- 284 bytes
Makefile -rw-r--r-- 1.6 KB
README -rw-r--r-- 1.2 KB
README.git -rw-r--r-- 728 bytes
aclocal.m4 -rw-r--r-- 420 bytes
configure -rwxr-xr-x 472.9 KB
configure.in -rw-r--r-- 75.4 KB

README

back to top