<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8585">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins2: Verified
  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/config: Use ast_cli_completion_add for reload completion.<br><br>Change-Id: Ia3fa4c03f2285a1ec8814bbe7f4624ead9111ad1<br>---<br>M main/config.c<br>1 file changed, 12 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/config.c b/main/config.c<br>index 38192ed..2a16a34 100644<br>--- a/main/config.c<br>+++ b/main/config.c<br>@@ -3932,8 +3932,8 @@<br> static char *handle_cli_config_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)<br> {<br>       struct cache_file_mtime *cfmtime;<br>-    char *prev = "", *completion_value = NULL;<br>- int wordlen, which = 0;<br>+      char *prev = "";<br>+   int wordlen;<br> <br>       switch (cmd) {<br>        case CLI_INIT:<br>@@ -3951,19 +3951,20 @@<br> <br>            AST_LIST_LOCK(&cfmtime_head);<br>             AST_LIST_TRAVERSE(&cfmtime_head, cfmtime, list) {<br>-                        /* Skip duplicates - this only works because the list is sorted by filename */<br>-                       if (strcmp(cfmtime->filename, prev) == 0) {<br>-                               continue;<br>-                    }<br>-<br>                  /* Core configs cannot be reloaded */<br>                         if (ast_strlen_zero(cfmtime->who_asked)) {<br>                                 continue;<br>                     }<br> <br>-                 if (++which > a->n && strncmp(cfmtime->filename, a->word, wordlen) == 0) {<br>-                               completion_value = ast_strdup(cfmtime->filename);<br>-                         break;<br>+                       /* Skip duplicates - this only works because the list is sorted by filename */<br>+                       if (!strcmp(cfmtime->filename, prev)) {<br>+                           continue;<br>+                    }<br>+<br>+                 if (!strncmp(cfmtime->filename, a->word, wordlen)) {<br>+                           if (ast_cli_completion_add(ast_strdup(cfmtime->filename))) {<br>+                                      break;<br>+                               }<br>                     }<br> <br>                  /* Otherwise save that we've seen this filename */<br>@@ -3971,7 +3972,7 @@<br>                 }<br>             AST_LIST_UNLOCK(&cfmtime_head);<br> <br>-               return completion_value;<br>+             return NULL;<br>  }<br> <br>  if (a->argc != 3) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8585">change 8585</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/8585"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia3fa4c03f2285a1ec8814bbe7f4624ead9111ad1 </div>
<div style="display:none"> Gerrit-Change-Number: 8585 </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: 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>