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)
committerIan Beckwith <ianb@erislabs.net>
Mon, 19 Apr 2010 16:11:15 +0000 (17:11 +0100)
commit6229a28f54486e8c623fd516db498a289d5ac0d7
treeb003b21258f2e40e0cebbbf18cfb5b2f5c3ab167
parentb39ad3299f70a8267e3dd979e7a2d22abcbe16ab
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.
(cherry picked from commit 61c96af09d3d2c917c69b17cc827e28a280db66c)
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