<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8596">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main/taskprocessor: Use ast_cli_completion_add.<br><br>Change-Id: Ie5f812a988ed811fd11967151932de62bc131b48<br>---<br>M main/taskprocessor.c<br>1 file changed, 9 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/taskprocessor.c b/main/taskprocessor.c<br>index cf82eff..91eb7d9 100644<br>--- a/main/taskprocessor.c<br>+++ b/main/taskprocessor.c<br>@@ -341,26 +341,27 @@<br> static char *tps_taskprocessor_tab_complete(struct ast_cli_args *a)<br> {<br> int tklen;<br>- int wordnum = 0;<br> struct ast_taskprocessor *p;<br>- char *name = NULL;<br> struct ao2_iterator i;<br> <br>- if (a->pos != 3)<br>+ if (a->pos != 3) {<br> return NULL;<br>+ }<br> <br> tklen = strlen(a->word);<br> i = ao2_iterator_init(tps_singletons, 0);<br> while ((p = ao2_iterator_next(&i))) {<br>- if (!strncasecmp(a->word, p->name, tklen) && ++wordnum > a->n) {<br>- name = ast_strdup(p->name);<br>- ast_taskprocessor_unreference(p);<br>- break;<br>+ if (!strncasecmp(a->word, p->name, tklen)) {<br>+ if (ast_cli_completion_add(ast_strdup(p->name))) {<br>+ ast_taskprocessor_unreference(p);<br>+ break;<br>+ }<br> }<br> ast_taskprocessor_unreference(p);<br> }<br> ao2_iterator_destroy(&i);<br>- return name;<br>+<br>+ return NULL;<br> }<br> <br> /* ping task handling function */<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8596">change 8596</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/8596"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie5f812a988ed811fd11967151932de62bc131b48 </div>
<div style="display:none"> Gerrit-Change-Number: 8596 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </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: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>