[Asterisk-code-review] core: fix getopt(3) usage (asterisk[15])
Guido Falsi
asteriskteam at digium.com
Mon Mar 26 07:50:38 CDT 2018
Guido Falsi has uploaded this change for review. ( https://gerrit.asterisk.org/8671
Change subject: core: fix getopt(3) usage
......................................................................
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
---
M main/asterisk.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/8671/1
diff --git a/main/asterisk.c b/main/asterisk.c
index 0442614..568feb0 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3995,7 +3995,7 @@
*
* \todo Document these options
*/
- optind = 0;
+ optind = 1;
while ((c = getopt(argc, argv, getopt_settings)) != -1) {
/*!\note Please keep the ordering here to alphabetical, capital letters
* first. This will make it easier in the future to select unused
--
To view, visit https://gerrit.asterisk.org/8671
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61
Gerrit-Change-Number: 8671
Gerrit-PatchSet: 1
Gerrit-Owner: Guido Falsi <madpilot at freebsd.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180326/8e8c0b9b/attachment-0001.html>
More information about the asterisk-code-review
mailing list