mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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
This commit is contained in:
parent
f1774f1a3b
commit
8d6d0ee43e
@ -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)
|
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);
|
g_return_if_fail(node != NULL);
|
||||||
|
|
||||||
|
if (parent == NULL)
|
||||||
|
parent = rec->mainnode;
|
||||||
|
|
||||||
rec->modifycounter++;
|
rec->modifycounter++;
|
||||||
cache_remove(rec, node);
|
cache_remove(rec, node);
|
||||||
parent->value = g_slist_remove(parent->value, node);
|
parent->value = g_slist_remove(parent->value, node);
|
||||||
|
Loading…
Reference in New Issue
Block a user