<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8598">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/98/8598/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/taskprocessor.c b/main/taskprocessor.c<br>index a464ada..7577715 100644<br>--- a/main/taskprocessor.c<br>+++ b/main/taskprocessor.c<br>@@ -343,26 +343,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/8598">change 8598</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/8598"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ie5f812a988ed811fd11967151932de62bc131b48 </div>
<div style="display:none"> Gerrit-Change-Number: 8598 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>