getopt-posix: detect MacOS bug
authorEric Blake <eblake@redhat.com>
Tue, 13 Apr 2010 20:30:37 +0000 (14:30 -0600)
committerIan Beckwith <ianb@erislabs.net>
Mon, 19 Apr 2010 16:06:03 +0000 (17:06 +0100)
commitd711c3032e93195bfb11d703f86af745a873e121
tree0ac0ed158ace601d8ff7f6c27bfc376165eb2382
parent8e4fc58cbd8e8e9eae2d0c7d6f3ac603ce9fc943
getopt-posix: detect MacOS bug

On MacOS 10.5 (Darwin 9.8.0), optind is incremented by 2 instead
of 1 in the case of a missing requirement on condensed options.

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Reject MacOS botch of
optind when missing a required argument.
* doc/posix-functions/getopt.texi (getopt): Document the bug.
* doc/glibc-functions/getopt_long.texi (getopt_long): Likewise.
* doc/glibc-functions/getopt_long_only.texi (getopt_long_only):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 5cc0bcf5e4689e1fb0c23b8368c46fdae0402028)
ChangeLog
doc/glibc-functions/getopt_long.texi
doc/glibc-functions/getopt_long_only.texi
doc/posix-functions/getopt.texi
m4/getopt.m4