registry: do quick check for . files

Do a quick check for . files before calling the strcmp functions
This commit is contained in:
Wim Taymans 2009-10-20 21:01:55 -04:00 committed by Wim Taymans
parent d833b39a85
commit 1be3d5cd83

View file

@ -950,8 +950,10 @@ gst_registry_scan_path_level (GstRegistryScanContext * context,
if (file_status.st_mode & S_IFDIR) {
/* skip the .debug directory, these contain elf files that are not
* useful or worse, can crash dlopen () */
if (g_str_equal (dirent, ".debug") || g_str_equal (dirent, ".git")) {
* useful or worse, can crash dlopen (). do a quick check for the . first
* and then call the compare functions. */
if (G_UNLIKELY (dirent[0] == '.' && (g_str_equal (dirent, ".debug")
|| g_str_equal (dirent, ".git")))) {
GST_LOG_OBJECT (context->registry, "ignoring .debug or .git directory");
g_free (filename);
continue;