summaryrefslogtreecommitdiff
path: root/main/config.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-11-15 20:05:26 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-11-15 20:05:26 +0000
commit1c86ec82221b6bfe63d3a97a15814e113f40976e (patch)
tree91739faa0494301b9b507fe13b58370fb8769b7e /main/config.c
parent00c5f6d032f6c9efbd237306d91359fbb082e1cd (diff)
Merged revisions 47690 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r47690 | kpfleming | 2006-11-15 14:01:22 -0600 (Wed, 15 Nov 2006) | 20 lines Merged revisions 47686,47688-47689 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47686 | kpfleming | 2006-11-15 13:42:05 -0600 (Wed, 15 Nov 2006) | 2 lines clear the category's variable tail pointer as well when variables are detached from it ........ r47688 | kpfleming | 2006-11-15 13:47:43 -0600 (Wed, 15 Nov 2006) | 2 lines when appending a list of variable to a category, ensure the tail pointer points to the last variable in the list ........ r47689 | kpfleming | 2006-11-15 13:58:46 -0600 (Wed, 15 Nov 2006) | 2 lines when re-writing the config file, don't repeat the path if it hasn't changed ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/config.c')
-rw-r--r--main/config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/config.c b/main/config.c
index 154ee320e..00ed17566 100644
--- a/main/config.c
+++ b/main/config.c
@@ -207,6 +207,8 @@ void ast_variable_append(struct ast_category *category, struct ast_variable *var
else
category->root = variable;
category->last = variable;
+ while (category->last->next)
+ category->last = category->last->next;
}
void ast_variables_destroy(struct ast_variable *v)
@@ -392,6 +394,7 @@ struct ast_variable *ast_category_detach_variables(struct ast_category *cat)
v = cat->root;
cat->root = NULL;
+ cat->last = NULL;
return v;
}
@@ -977,7 +980,10 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn);
fprintf(f, ";!\n");
fprintf(f, ";! Automatically generated configuration file\n");
- fprintf(f, ";! Filename: %s (%s)\n", configfile, fn);
+ if (strcmp(configfile, fn))
+ fprintf(f, ";! Filename: %s (%s)\n", configfile, fn);
+ else
+ fprintf(f, ";! Filename: %s\n", configfile);
fprintf(f, ";! Generator: %s\n", generator);
fprintf(f, ";! Creation Date: %s", date);
fprintf(f, ";!\n");