<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7470">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CLI: Fix remote console completion.<br><br>Duplicate checking was done incorrectly when parsing completion options<br>from a remote console causing all options to be ignored as duplicates.<br>Once fixed I had to separate processing of the best match to ensure it<br>was not identified as a duplicate when it is the only match.<br><br>ASTERISK-27465<br><br>Change-Id: Ibbdb29f88211742071836c9b3f4d2aa1221cd0f9<br>---<br>M main/asterisk.c<br>1 file changed, 11 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/asterisk.c b/main/asterisk.c<br>index 0abb360..bc78687 100644<br>--- a/main/asterisk.c<br>+++ b/main/asterisk.c<br>@@ -3133,10 +3133,17 @@<br> static struct ast_vector_string *ast_el_strtoarr(char *buf)<br> {<br>        char *retstr;<br>+        char *bestmatch;<br>      struct ast_vector_string *vec = ast_calloc(1, sizeof(*vec));<br> <br>       if (!vec) {<br>           return NULL;<br>+ }<br>+<br>+ /* bestmatch must not be deduplicated */<br>+     bestmatch = strsep(&buf, " ");<br>+ if (!bestmatch || !strcmp(bestmatch, AST_CLI_COMPLETE_EOF)) {<br>+                goto vector_cleanup;<br>  }<br> <br>  while ((retstr = strsep(&buf, " "))) {<br>@@ -3145,7 +3152,7 @@<br>           }<br> <br>          /* Older daemons sent duplicates. */<br>-         if (AST_VECTOR_GET_CMP(vec, retstr, strcasecmp)) {<br>+           if (AST_VECTOR_GET_CMP(vec, retstr, !strcasecmp)) {<br>                   continue;<br>             }<br> <br>@@ -3157,7 +3164,9 @@<br>           }<br>     }<br> <br>- if (!AST_VECTOR_SIZE(vec)) {<br>+ bestmatch = ast_strdup(bestmatch);<br>+   if (!bestmatch || AST_VECTOR_INSERT_AT(vec, 0, bestmatch)) {<br>+         ast_free(bestmatch);<br>          goto vector_cleanup;<br>  }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7470">change 7470</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/7470"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ibbdb29f88211742071836c9b3f4d2aa1221cd0f9 </div>
<div style="display:none"> Gerrit-Change-Number: 7470 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>