[glib] Fix gsettings tool crash
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Fix gsettings tool crash
- Date: Sat, 19 Jun 2010 16:38:08 +0000 (UTC)
commit 62939f5e45cd102313285ec13f90c3b4763e6ca8
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Sat Jun 19 18:33:26 2010 +0200
Fix gsettings tool crash
When no path is provided for the schema, we have call
g_settings_new() instead of g_settings_new_with_path()
passing a NULL path.
This was crashing the tool on start since an assertion was
recently added to g_settings_new_with_path() to refuse NULL.
gio/gsettings-tool.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c
index 3f7d478..7f07f4e 100644
--- a/gio/gsettings-tool.c
+++ b/gio/gsettings-tool.c
@@ -132,7 +132,10 @@ handle_get (gint *argc,
schema = (*argv)[1];
key = (*argv)[2];
- settings = g_settings_new_with_path (schema, path);
+ if (path)
+ settings = g_settings_new_with_path (schema, path);
+ else
+ settings = g_settings_new (schema);
v = g_settings_get_value (settings, key);
g_print ("%s\n", g_variant_print (v, FALSE));
@@ -193,7 +196,10 @@ handle_set (gint *argc,
key = (*argv)[2];
value = (*argv)[3];
- settings = g_settings_new_with_path (schema, path);
+ if (path)
+ settings = g_settings_new_with_path (schema, path);
+ else
+ settings = g_settings_new (schema);
v = g_settings_get_value (settings, key);
type = g_variant_get_type (v);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]