<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8595">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">named_acl: Use ast_cli_completion_add.<br><br>Change-Id: I317a82de976bbdbfe4352c243e32a7bb8f66c377<br>---<br>M main/named_acl.c<br>1 file changed, 13 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/named_acl.c b/main/named_acl.c<br>index 9ea8990..826313d 100644<br>--- a/main/named_acl.c<br>+++ b/main/named_acl.c<br>@@ -502,12 +502,10 @@<br> /* \brief ACL command show <name> */<br> static char *handle_show_named_acl_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)<br> {<br>- RAII_VAR(struct named_acl_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);<br>+ struct named_acl_config *cfg;<br> int length;<br>- int which;<br> struct ao2_iterator i;<br> struct named_acl *named_acl;<br>- char *match = NULL;<br> <br> switch (cmd) {<br> case CLI_INIT:<br>@@ -517,23 +515,29 @@<br> " Shows a list of named ACLs or lists all entries in a given named ACL.\n";<br> return NULL;<br> case CLI_GENERATE:<br>+ if (a->pos != 2) {<br>+ return NULL;<br>+ }<br>+<br>+ cfg = ao2_global_obj_ref(globals);<br> if (!cfg) {<br> return NULL;<br> }<br> length = strlen(a->word);<br>- which = 0;<br> i = ao2_iterator_init(cfg->named_acl_list, 0);<br> while ((named_acl = ao2_iterator_next(&i))) {<br>- if (!strncasecmp(a->word, named_acl->name, length) && ++which > a->n) {<br>- match = ast_strdup(named_acl->name);<br>- ao2_ref(named_acl, -1);<br>- break;<br>+ if (!strncasecmp(a->word, named_acl->name, length)) {<br>+ if (ast_cli_completion_add(ast_strdup(named_acl->name))) {<br>+ ao2_ref(named_acl, -1);<br>+ break;<br>+ }<br> }<br> ao2_ref(named_acl, -1);<br> }<br> ao2_iterator_destroy(&i);<br>- return match;<br>+ ao2_ref(cfg, -1);<br> <br>+ return NULL;<br> }<br> <br> if (a->argc == 2) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8595">change 8595</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/8595"/><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: I317a82de976bbdbfe4352c243e32a7bb8f66c377 </div>
<div style="display:none"> Gerrit-Change-Number: 8595 </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: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>