<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19805">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">manager: Fix appending variables.<br><br>The if statement here is always false after the for<br>loop finishes, so variables are never appended.<br>This removes that to properly append to the end<br>of the variable list.<br><br>ASTERISK-30351 #close<br>Reported by: Sebastian Gutierrez<br><br>Change-Id: I1b7f8b85a8918f6a814cb933a479d4278cf16199<br>---<br>M main/manager.c<br>1 file changed, 19 insertions(+), 4 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/manager.c b/main/manager.c</span><br><span>index 8a198b3..c5a48fd 100644</span><br><span>--- a/main/manager.c</span><br><span>+++ b/main/manager.c</span><br><span>@@ -6274,14 +6274,12 @@</span><br><span>               old = vars;</span><br><span>          vars = NULL;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-                /* The variables in the AMI originate action are appended at the end of the list, to override any user variables that apply*/</span><br><span style="color: hsl(120, 100%, 40%);">+         /* The variables in the AMI originate action are appended at the end of the list, to override any user variables that apply */</span><br><span> </span><br><span>           vars = ast_variables_dup(s->session->chanvars);</span><br><span>                if (old) {</span><br><span>                   for (v = vars; v->next; v = v->next );</span><br><span style="color: hsl(0, 100%, 40%);">-                    if (v->next) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               v->next = old;       /* Append originate variables at end of list */</span><br><span style="color: hsl(0, 100%, 40%);">-                 }</span><br><span style="color: hsl(120, 100%, 40%);">+                     v->next = old;       /* Append originate variables at end of list */</span><br><span>              }</span><br><span>    }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19805">change 19805</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/19805"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I1b7f8b85a8918f6a814cb933a479d4278cf16199 </div>
<div style="display:none"> Gerrit-Change-Number: 19805 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>