gconf-3.2.6-gsettings-data-convert-paths.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 405f865c07261a95c8c9a09a84ab679c6dd0a330 Mon Sep 17 00:00:00 2001
  2. From: Colin Walters <walters@verbum.org>
  3. Date: Thu, 24 Oct 2013 16:27:24 -0400
  4. Subject: gsettings-data-convert: Warn (and fix) invalid schema paths
  5. See https://bugzilla.gnome.org/show_bug.cgi?id=704802
  6. https://bugzilla.gnome.org/show_bug.cgi?id=710836
  7. diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
  8. index 9b2d1d0..160ed41 100644
  9. --- a/gsettings/gsettings-data-convert.c
  10. +++ b/gsettings/gsettings-data-convert.c
  11. @@ -182,7 +182,23 @@ handle_file (const gchar *filename)
  12. }
  13. if (schema_path[1] != NULL)
  14. - settings = g_settings_new_with_path (schema_path[0], schema_path[1]);
  15. + {
  16. + char *compat_path_alloced = NULL;
  17. + char *compat_path;
  18. + /* Work around broken .convert files:
  19. + https://bugzilla.gnome.org/show_bug.cgi?id=704802
  20. + */
  21. + if (!g_str_has_suffix (schema_path[1], "/"))
  22. + {
  23. + g_warning ("Schema file '%s' has missing trailing / in '%s'",
  24. + filename, schema_path[1]);
  25. + compat_path = compat_path_alloced = g_strconcat (schema_path[1], "/", NULL);
  26. + }
  27. + else
  28. + compat_path = schema_path[1];
  29. + settings = g_settings_new_with_path (schema_path[0], compat_path);
  30. + g_free (compat_path_alloced);
  31. + }
  32. else
  33. settings = g_settings_new (schema_path[0]);
  34. --
  35. cgit v0.10.1