summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-10-20 21:01:55 -0400
committerWim Taymans <wim@metal.(none)>2009-10-20 21:15:56 -0400
commit1be3d5cd832e21b2ec0185b7f378f4e22e9787fb (patch)
treed017c43dc3fdacde42dbb6cc88e1fece45f529c8
parentd833b39a852b73b3d33165b1c9343e0725d0d7b9 (diff)
registry: do quick check for . files
Do a quick check for . files before calling the strcmp functions
-rw-r--r--gst/gstregistry.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index 58b5c5504f..815a30a3b9 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -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;