Do a quick check for . files before calling the strcmp functions
if (file_status.st_mode & S_IFDIR) {
/* skip the .debug directory, these contain elf files that are not
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;
GST_LOG_OBJECT (context->registry, "ignoring .debug or .git directory");
g_free (filename);
continue;