diff --git a/ChangeLog b/ChangeLog index 8ad73d70d5..d31d50ae85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-06-06 ed@catmur.co.uk + + reviewed by Benjamin Otte + + * gst/registries/gstxmlregistry.c: + (gst_xml_registry_rebuild_recurse): + don't rely on g_dir_open to figure out if a file is a directory, use + explicit G_TEST_IS_DIR. Reiserfs4 allows opening files as + directories. (fixes #142850) + 2004-06-06 Benjamin Otte * gst/gstqueue.c: (gst_queue_dispose), (gst_queue_change_state): diff --git a/gst/registries/gstxmlregistry.c b/gst/registries/gstxmlregistry.c index ce1735785e..03d29a7794 100644 --- a/gst/registries/gstxmlregistry.c +++ b/gst/registries/gstxmlregistry.c @@ -1331,30 +1331,31 @@ static GList * gst_xml_registry_rebuild_recurse (GstXMLRegistry * registry, const gchar * directory) { - GDir *dir; GList *ret = NULL; gint dr_len, sf_len; - dir = g_dir_open (directory, 0, NULL); + if (g_file_test (directory, G_FILE_TEST_IS_DIR)) { + GDir *dir = g_dir_open (directory, 0, NULL); - if (dir) { - const gchar *dirent; + if (dir) { + const gchar *dirent; - while ((dirent = g_dir_read_name (dir))) { - gchar *dirname; + while ((dirent = g_dir_read_name (dir))) { + gchar *dirname; - if (*dirent == '=') { - /* =build, =inst, etc. -- automake distcheck directories */ - continue; + if (*dirent == '=') { + /* =build, =inst, etc. -- automake distcheck directories */ + continue; + } + + dirname = g_strjoin ("/", directory, dirent, NULL); + ret = + g_list_concat (ret, gst_xml_registry_rebuild_recurse (registry, + dirname)); + g_free (dirname); } - - dirname = g_strjoin ("/", directory, dirent, NULL); - ret = - g_list_concat (ret, gst_xml_registry_rebuild_recurse (registry, - dirname)); - g_free (dirname); + g_dir_close (dir); } - g_dir_close (dir); } else { dr_len = strlen (directory); sf_len = strlen (G_MODULE_SUFFIX);