From 308ee024f260de5cf6f0ae28eb7202876158ca58 Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Sun, 20 Sep 2015 20:45:06 +0100 Subject: [PATCH] rename node to parent to prevent having variables at 2 scopes with the same name. --- src/lib-config/get.c | 8 ++++---- src/lib-config/iconfig.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib-config/get.c b/src/lib-config/get.c index a83686fd..f3a6b563 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -20,15 +20,15 @@ #include "module.h" -CONFIG_NODE *config_node_find(CONFIG_NODE *node, const char *key) +CONFIG_NODE *config_node_find(CONFIG_NODE *parent, const char *key) { GSList *tmp; - g_return_val_if_fail(node != NULL, NULL); + g_return_val_if_fail(parent != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); - g_return_val_if_fail(is_node_list(node), NULL); + g_return_val_if_fail(is_node_list(parent), NULL); - for (tmp = node->value; tmp != NULL; tmp = tmp->next) { + for (tmp = parent->value; tmp != NULL; tmp = tmp->next) { CONFIG_NODE *node = tmp->data; if (node->key != NULL && g_ascii_strcasecmp(node->key, key) == 0) diff --git a/src/lib-config/iconfig.h b/src/lib-config/iconfig.h index 91583e40..cc2cbf79 100644 --- a/src/lib-config/iconfig.h +++ b/src/lib-config/iconfig.h @@ -113,7 +113,7 @@ int config_set_bool(CONFIG_REC *rec, const char *section, const char *key, int v /* Handling the configuration directly with nodes - useful when you need to read all values in a block/list. */ -CONFIG_NODE *config_node_find(CONFIG_NODE *node, const char *key); +CONFIG_NODE *config_node_find(CONFIG_NODE *parent, const char *key); /* Find the section from node - if not found create it unless new_type is -1. You can also specify in new_type if it's NODE_TYPE_LIST or NODE_TYPE_BLOCK */ CONFIG_NODE *config_node_section(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key, int new_type);