mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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.
This commit is contained in:
parent
a768953760
commit
62939f5e45
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user