From 4482d518b85f395101085c74b00feee9ca678c5a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 14 Apr 2000 12:49:02 +0000 Subject: [PATCH] section can be NULL - which is same as "". Fixed several functions to allow it. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@164 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/lib-config/get.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib-config/get.c b/src/lib-config/get.c index e29df699..b5c3f42e 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -107,11 +107,10 @@ char *config_get_str(CONFIG_REC *rec, const char *section, const char *key, cons char *path; g_return_val_if_fail(rec != NULL, (char *) def); - g_return_val_if_fail(section != NULL, (char *) def); g_return_val_if_fail(key != NULL, (char *) def); /* check if it already exists in cache */ - path = g_strconcat(section, "/", key, NULL); + path = g_strconcat(section == NULL ? "" : section, "/", key, NULL); node = g_hash_table_lookup(rec->cache, path); if (node != NULL) @@ -168,7 +167,6 @@ CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const c GSList *tmp; g_return_val_if_fail(rec != NULL, NULL); - g_return_val_if_fail(section != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); g_return_val_if_fail(value_key != NULL, NULL);