summaryrefslogtreecommitdiff
path: root/src/lib-config
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib-config')
-rw-r--r--src/lib-config/get.c12
-rw-r--r--src/lib-config/iconfig.h3
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib-config/get.c b/src/lib-config/get.c
index 21b97251..518cab40 100644
--- a/src/lib-config/get.c
+++ b/src/lib-config/get.c
@@ -309,10 +309,9 @@ CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index)
return NULL;
}
-/* Returns the next non-comment node in list */
-GSList *config_node_next(GSList *list)
+/* Returns the first non-comment node in list */
+GSList *config_node_first(GSList *list)
{
- list = list->next;
while (list != NULL) {
CONFIG_NODE *node = list->data;
@@ -322,3 +321,10 @@ GSList *config_node_next(GSList *list)
}
return list;
}
+
+/* Returns the next non-comment node in list */
+GSList *config_node_next(GSList *list)
+{
+ list = list->next;
+ return config_node_first(list);
+}
diff --git a/src/lib-config/iconfig.h b/src/lib-config/iconfig.h
index d63af031..fc475f4e 100644
--- a/src/lib-config/iconfig.h
+++ b/src/lib-config/iconfig.h
@@ -99,6 +99,9 @@ const char *config_list_find(CONFIG_REC *rec, const char *section, const char *k
CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key);
/* Returns n'th node from list. */
CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index);
+
+/* Returns the first non-comment node in list */
+GSList *config_node_first(GSList *list);
/* Returns the next non-comment node in list */
GSList *config_node_next(GSList *list);