summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-05-16 12:49:57 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-05-16 12:49:57 +0000
commit86ca72eb302bc00c6c58b56d20ba06f1d7000214 (patch)
tree701c46e649900612db60097aaac74acdcbc50447 /network
parent3642221a7953346bb326b5aa23075e96e4cf5e0b (diff)
Use g_key_file_get_string_list instead of g_key_file_get_string
Diffstat (limited to 'network')
-rw-r--r--network/main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/network/main.c b/network/main.c
index f710080f..02c3fcc8 100644
--- a/network/main.c
+++ b/network/main.c
@@ -68,7 +68,7 @@ static void read_config(const char *file)
{
GKeyFile *keyfile;
GError *err = NULL;
- char *disabled;
+ char **disabled;
keyfile = g_key_file_new();
@@ -78,19 +78,22 @@ static void read_config(const char *file)
goto done;
}
- disabled = g_key_file_get_string(keyfile, "General",
- "Disable", &err);
+ disabled = g_key_file_get_string_list(keyfile, "General",
+ "Disable", NULL, &err);
if (err) {
debug("%s: %s", file, err->message);
g_error_free(err);
err = NULL;
} else {
- if (strstr(disabled, "Connection"))
- conf.connection_enabled = FALSE;
- if (strstr(disabled, "Server"))
- conf.server_enabled = FALSE;
+ int i;
+ for (i = 0; disabled[i] != NULL; i++) {
+ if (g_str_equal(disabled[i], "Connection"))
+ conf.connection_enabled = FALSE;
+ else if (g_str_equal(disabled[i], "Server"))
+ conf.server_enabled = FALSE;
+ }
+ g_strfreev(disabled);
}
- g_free(disabled);
conf.security = !g_key_file_get_boolean(keyfile, "General",
"DisableSecurity", &err);