<p>Guido Falsi has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8671">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: fix getopt(3) usage<br><br>Setting optind = 0 is forced to 1 in glibc implementation, but<br>causes option parsing to be flawed in other implementations, for<br>example on FreeBSD.<br><br>ASTERISK-27773 #close<br><br>Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61<br>---<br>M main/asterisk.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/8671/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/asterisk.c b/main/asterisk.c<br>index 0442614..568feb0 100644<br>--- a/main/asterisk.c<br>+++ b/main/asterisk.c<br>@@ -3995,7 +3995,7 @@<br> *<br> * \todo Document these options<br> */<br>- optind = 0;<br>+ optind = 1;<br> while ((c = getopt(argc, argv, getopt_settings)) != -1) {<br> /*!\note Please keep the ordering here to alphabetical, capital letters<br> * first. This will make it easier in the future to select unused<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8671">change 8671</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8671"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia548e69f8302e9754dbbedb6bc451c0700c66f61 </div>
<div style="display:none"> Gerrit-Change-Number: 8671 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Guido Falsi <madpilot@freebsd.org> </div>