vfs: Fix return value of get_supported_uri_schemes()

The function is expected to return a %NULL-terminated array, but
commit 375b4ca65c dropped the sentinel when adding support for
additional custom schemes. Add it back.

https://bugzilla.gnome.org/show_bug.cgi?id=768119
This commit is contained in:
Florian Müllner 2016-06-28 01:58:13 +02:00
parent e57355b055
commit a42bdecf5c
2 changed files with 5 additions and 0 deletions

View File

@ -295,6 +295,8 @@ g_vfs_get_supported_uri_schemes (GVfs *vfs)
g_rw_lock_reader_unlock (&additional_schemes_lock);
g_ptr_array_add (supported_schemes, NULL);
g_free (priv->supported_schemes);
priv->supported_schemes =
(char const **) g_ptr_array_free (supported_schemes, FALSE);

View File

@ -63,6 +63,9 @@ test_register_scheme (void)
g_assert_nonnull (vfs);
g_assert_true (g_vfs_is_active (vfs));
schemes = g_vfs_get_supported_uri_schemes (vfs);
g_assert_false (g_strv_contains (schemes, "test"));
res = g_vfs_unregister_uri_scheme (vfs, "test");
g_assert_false (res);