aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_spool.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-21 18:44:53 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-21 18:44:53 +0000
commit05cb0f41010b3527e2da0c6b80d4102d3868ac8a (patch)
treeab4a5f5870fdd4d8a148623cbde0905eb81d7696 /pbx/pbx_spool.c
parent741ba21e7eb7330dda284110d9dd069c1fff7b6e (diff)
Revert accidental commit of the last change
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@117523 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_spool.c')
-rw-r--r--pbx/pbx_spool.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 931697142..8cf38a116 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -128,11 +128,7 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
char buf[256];
char *c, *c2;
int lineno = 0;
- struct ast_variable *var, *last = o->vars;
-
- while (last && last->next) {
- last = last->next;
- }
+ struct ast_variable *var;
while(fgets(buf, sizeof(buf), f)) {
lineno++;
@@ -226,13 +222,8 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
if (c2) {
var = ast_variable_new(c, c2);
if (var) {
- /* Always insert at the end, because some people want to treat the spool file as a script */
- if (last) {
- last->next = var;
- } else {
- o->vars = var;
- }
- last = var;
+ var->next = o->vars;
+ o->vars = var;
}
} else
ast_log(LOG_WARNING, "Malformed \"%s\" argument. Should be \"%s: variable=value\"\n", buf, buf);