summaryrefslogtreecommitdiff
path: root/src/lib-config
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-06 19:14:51 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-06 19:14:51 +0000
commit4282f07347d64d14aa5c6b9614f392518c2f13c1 (patch)
tree14c848f0e5177af0b3c444e53b484068eac44398 /src/lib-config
parent0a1282765e39152168cd9d15e8dc34752bbb42d0 (diff)
downloadirssi-4282f07347d64d14aa5c6b9614f392518c2f13c1.zip
If config_node_get_str() is given NULL node, return the given default.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@301 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/lib-config')
-rw-r--r--src/lib-config/get.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib-config/get.c b/src/lib-config/get.c
index 07a328ce..0a41272b 100644
--- a/src/lib-config/get.c
+++ b/src/lib-config/get.c
@@ -197,6 +197,8 @@ char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def)
{
CONFIG_NODE *node;
+ if (parent == NULL) return (char *) def;
+
node = config_node_find(parent, key);
return (node == NULL || !has_node_value(node)) ? def : node->value;
}