summaryrefslogtreecommitdiff
path: root/src/lib-config
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-05-11 19:53:39 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-05-11 19:53:39 +0000
commit8d6d0ee43e2726f6e3863dff1b8bc39d20d18996 (patch)
treefc499d352b0e6bba314459e4a1df4f6b709140d7 /src/lib-config
parentf1774f1a3bfdf9b124e708014e8caf3a4f764ce5 (diff)
downloadirssi-8d6d0ee43e2726f6e3863dff1b8bc39d20d18996.zip
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
Diffstat (limited to 'src/lib-config')
-rw-r--r--src/lib-config/set.c4
1 files changed, 3 insertions, 1 deletions
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);