[asterisk-commits] rbrindley: trunk r158078 - /trunk/main/config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Nov 20 11:53:43 CST 2008
Author: rbrindley
Date: Thu Nov 20 11:53:42 2008
New Revision: 158078
URL: http://svn.digium.com/view/asterisk?view=rev&rev=158078
Log:
more formatting corrections :: one line for loops and if statements still need {}
Modified:
trunk/main/config.c
Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?view=diff&rev=158078&r1=158077&r2=158078
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Thu Nov 20 11:53:42 2008
@@ -359,16 +359,18 @@
int lineno;
int insertline;
- if (!variable || sscanf(line, "%d", &insertline) != 1)
+ if (!variable || sscanf(line, "%d", &insertline) != 1) {
return;
+ }
if (!insertline) {
variable->next = category->root;
category->root = variable;
} else {
for (lineno = 1; lineno < insertline; lineno++) {
cur = cur->next;
- if (!cur->next)
+ if (!cur->next) {
break;
+ }
}
variable->next = cur->next;
cur->next = variable;
@@ -390,10 +392,11 @@
{
struct ast_category *cat = NULL;
- if (category && config->last_browse && (config->last_browse->name == category))
+ if (category && config->last_browse && (config->last_browse->name == category)) {
cat = config->last_browse;
- else
+ } else {
cat = ast_category_get(config, category);
+ }
return (cat) ? cat->root : NULL;
}
@@ -402,8 +405,9 @@
{
const char *tmp;
tmp = ast_variable_retrieve(cfg, cat, var);
- if (!tmp)
+ if (!tmp) {
tmp = ast_variable_retrieve(cfg, "general", var);
+ }
return tmp;
}
@@ -414,8 +418,9 @@
if (category) {
for (v = ast_variable_browse(config, category); v; v = v->next) {
- if (!strcasecmp(variable, v->name))
+ if (!strcasecmp(variable, v->name)) {
return v->value;
+ }
}
} else {
struct ast_category *cat;
More information about the asterisk-commits
mailing list