]> Savannah Git Hosting - gnulib.git/commit
getopt: tidy up _getopt_initialize a bit
authorZack Weinberg <zackw@panix.com>
Thu, 6 Apr 2017 18:14:14 +0000 (11:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Apr 2017 22:42:03 +0000 (15:42 -0700)
commitef3ea3cc018210b9ae5cb6ee2f1de999667ce4be
tree90e20d704c1fbdf4614880fea2dd4c7f951c7fc5
parentd72c5a7bed87ea43863479657285c19dc968c1dd
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?)

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