summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-10-24 16:27:24 -0400
committerColin Walters <walters@verbum.org>2013-10-24 16:30:39 -0400
commit405f865c07261a95c8c9a09a84ab679c6dd0a330 (patch)
tree3b04c68c554f55b49e1c9efa1bb7879a72ae6607
parentb0895e1998ebc83ab030ec0f17c0685439f5b404 (diff)
downloadgconf-405f865c07261a95c8c9a09a84ab679c6dd0a330.tar.gz
gsettings-data-convert: Warn (and fix) invalid schema paths
See https://bugzilla.gnome.org/show_bug.cgi?id=704802 https://bugzilla.gnome.org/show_bug.cgi?id=710836
-rw-r--r--gsettings/gsettings-data-convert.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
index 9b2d1d02..160ed414 100644
--- a/gsettings/gsettings-data-convert.c
+++ b/gsettings/gsettings-data-convert.c
@@ -182,7 +182,23 @@ handle_file (const gchar *filename)
}
if (schema_path[1] != NULL)
- settings = g_settings_new_with_path (schema_path[0], schema_path[1]);
+ {
+ char *compat_path_alloced = NULL;
+ char *compat_path;
+ /* Work around broken .convert files:
+ https://bugzilla.gnome.org/show_bug.cgi?id=704802
+ */
+ if (!g_str_has_suffix (schema_path[1], "/"))
+ {
+ g_warning ("Schema file '%s' has missing trailing / in '%s'",
+ filename, schema_path[1]);
+ compat_path = compat_path_alloced = g_strconcat (schema_path[1], "/", NULL);
+ }
+ else
+ compat_path = schema_path[1];
+ settings = g_settings_new_with_path (schema_path[0], compat_path);
+ g_free (compat_path_alloced);
+ }
else
settings = g_settings_new (schema_path[0]);