Commit a42bdecf authored by Florian Müllner's avatar Florian Müllner

vfs: Fix return value of get_supported_uri_schemes()

The function is expected to return a %NULL-terminated array, but
commit 375b4ca6 dropped the sentinel when adding support for
additional custom schemes. Add it back.
parent e57355b0
...@@ -295,6 +295,8 @@ g_vfs_get_supported_uri_schemes (GVfs *vfs) ...@@ -295,6 +295,8 @@ g_vfs_get_supported_uri_schemes (GVfs *vfs)
g_rw_lock_reader_unlock (&additional_schemes_lock); g_rw_lock_reader_unlock (&additional_schemes_lock);
g_ptr_array_add (supported_schemes, NULL);
g_free (priv->supported_schemes); g_free (priv->supported_schemes);
priv->supported_schemes = priv->supported_schemes =
(char const **) g_ptr_array_free (supported_schemes, FALSE); (char const **) g_ptr_array_free (supported_schemes, FALSE);
...@@ -63,6 +63,9 @@ test_register_scheme (void) ...@@ -63,6 +63,9 @@ test_register_scheme (void)
g_assert_nonnull (vfs); g_assert_nonnull (vfs);
g_assert_true (g_vfs_is_active (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"); res = g_vfs_unregister_uri_scheme (vfs, "test");
g_assert_false (res); g_assert_false (res);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment