From 8d6d0ee43e2726f6e3863dff1b8bc39d20d18996 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 11 May 2001 19:53:39 +0000 Subject: config_node_remove() - NULL parent is treated as root node git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1490 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/lib-config/set.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib-config') diff --git a/src/lib-config/set.c b/src/lib-config/set.c index 99b9583e..fdb358f9 100644 --- a/src/lib-config/set.c +++ b/src/lib-config/set.c @@ -34,9 +34,11 @@ static void cache_remove(CONFIG_REC *rec, CONFIG_NODE *node) void config_node_remove(CONFIG_REC *rec, CONFIG_NODE *parent, CONFIG_NODE *node) { - g_return_if_fail(parent != NULL); g_return_if_fail(node != NULL); + if (parent == NULL) + parent = rec->mainnode; + rec->modifycounter++; cache_remove(rec, node); parent->value = g_slist_remove(parent->value, node); -- cgit v1.2.3