mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 12:20:12 +00:00
core: fix getopt(3) usage
Setting optind = 0 is forced to 1 in glibc implementation, but causes option parsing to be flawed in other implementations, for example on FreeBSD. ASTERISK-27773 #close Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61
This commit is contained in:
@@ -3963,7 +3963,7 @@ int main(int argc, char *argv[])
|
|||||||
*
|
*
|
||||||
* \todo Document these options
|
* \todo Document these options
|
||||||
*/
|
*/
|
||||||
optind = 0;
|
optind = 1;
|
||||||
while ((c = getopt(argc, argv, getopt_settings)) != -1) {
|
while ((c = getopt(argc, argv, getopt_settings)) != -1) {
|
||||||
/*!\note Please keep the ordering here to alphabetical, capital letters
|
/*!\note Please keep the ordering here to alphabetical, capital letters
|
||||||
* first. This will make it easier in the future to select unused
|
* first. This will make it easier in the future to select unused
|
||||||
|
Reference in New Issue
Block a user