]> git.ipfire.org Git - thirdparty/glibc.git/commit
getopt: tidy up _getopt_initialize a bit
authorZack Weinberg <zackw@panix.com>
Sat, 1 Apr 2017 16:42:41 +0000 (12:42 -0400)
committerZack Weinberg <zackw@panix.com>
Fri, 7 Apr 2017 11:50:31 +0000 (07:50 -0400)
commitc1af8775f2de694bd567813af51164e2d978a78d
treefb0696a62187bc79ad4ed5f3186c9d65389ad79a
parent7a7be6c9a2a89ac5783d4f27d67b0fae3218228f
getopt: tidy up _getopt_initialize a bit

_getopt_data.__posixly_correct is completely redundant to
_getopt_data.__ordering, and some work that logically belongs in
_getopt_initialize was being done by _getopt_internal_r, making the
code harder to understand.

As a side effect, getenv will no longer be called if the first
character of the options string is '+' or '-', which is probably a
Good Thing.  (Perhaps we should have a flag character that
specifically asks for the permutation behavior?)

* posix/getopt_int.h (_getopt_data): Remove __posixly_correct field.
* posix/getopt.c (_getopt_internal_r): Move some initialization code...
(_getopt_initialize): ...here. Don't set d->__posixly_correct.
ChangeLog
posix/getopt.c
posix/getopt_int.h