getopt-gnu: match recent glibc fixes and posix ruling
authorEric Blake <eblake@redhat.com>
Fri, 9 Apr 2010 22:34:16 +0000 (16:34 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 13 Apr 2010 22:31:48 +0000 (16:31 -0600)
commit61c96af09d3d2c917c69b17cc827e28a280db66c
treed5372edbd89383457350e92d8f3ec67f7f09400c
parentdb3e2806244ae65274db73e6cbd09ca5e9ac4cf8
getopt-gnu: match recent glibc fixes and posix ruling

The POSIX folks admitted that codifying the behavior of GNU
getopt on a leading '+' in optstring is worthwhile, for writing
programs such as env(1) even when POSIXLY_CORRECT is not defined.
http://austingroupbugs.net/view.php?id=191
However, the ruling is an enhancement request for the next
version of POSIX, and is not binding on platforms that comply
with POSIX 2008, so it should only be enforced for getopt-gnu.

* tests/test-getopt.h (test_getopt): Strengthen tests of leading
'+' handling, when requesting extensions.
* tests/test-getopt_long.h (test_getopt_long): Strengthen test of
'W;' handling.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Detect glibc 2.11 bug.
* doc/posix-functions/getopt.texi (getopt): Document this.
* doc/glibc-functions/getopt_long.texi (getopt_long): Likewise.
* doc/glibc-functions/getopt_long_only.texi (getopt_long_only):
Likewise.
ChangeLog
doc/glibc-functions/getopt_long.texi
doc/glibc-functions/getopt_long_only.texi
doc/posix-functions/getopt.texi
m4/getopt.m4
tests/test-getopt.h
tests/test-getopt_long.h