mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
gst/registries/gstxmlregistry.c: don't rely on g_dir_open to figure out if a file is a directory, use explicit G_TEST...
Original commit message from CVS: reviewed by Benjamin Otte <otte@gnome.org> * 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)
This commit is contained in:
parent
502660a784
commit
60de88e46c
2 changed files with 27 additions and 16 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2004-06-06 ed@catmur.co.uk
|
||||
|
||||
reviewed by Benjamin Otte <otte@gnome.org>
|
||||
|
||||
* 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 <otte@gnome.org>
|
||||
|
||||
* gst/gstqueue.c: (gst_queue_dispose), (gst_queue_change_state):
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue