getopt-gnu: avoid crash in glibc getopt
authorEric Blake <eblake@redhat.com>
Thu, 7 Jul 2011 16:24:20 +0000 (10:24 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 7 Jul 2011 16:58:40 +0000 (10:58 -0600)
commit366d08c003506c7ed3c040289f191e1f5b3eb4af
tree5ecebfe772ae314c654461523149300c1b83af34
parentc4bf665bae3880a9a8974d64c1fad9fe2c80079f
getopt-gnu: avoid crash in glibc getopt

Use of "W;" in an option string may be rare, but we might as well
avoid crashing on it.

* m4/getopt.m4 (gl_GETOPT_CHECK_HEADRS): Detect the problem.
* tests/test-getopt.h (test_getopt): Enhance test.
* tests/test-getopt_long.h (test_getopt_long): Likewise.
* doc/posix-functions/getopt.texi (getopt): Document it.
* 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>
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