readdir.c
changeset 1 9ccc1574a367
parent 0 7d3c07f8acfb
child 3 ed325d60fa34
--- a/readdir.c	Thu Dec 23 00:46:07 2010 +0100
+++ b/readdir.c	Thu Dec 23 01:06:04 2010 +0100
@@ -1,3 +1,5 @@
+#include <string.h>
+#include <stdlib.h>
 #include <dirent.h>
 #include "dl.h"
 
@@ -14,13 +16,14 @@
     struct dirent *dent;
 
     if (!orig) 
-	orig = get_original_function("libc.so.6", "readdir64");
+	orig = lib_function("readdir64", NULL);
 
     dent = (*orig)(dirp);
 
     /* skip selected entries */
-    if (dent && dent->d_name[0] == 'M') 
+    while (dent && strchr(dent->d_name, '.')) {
 	dent = (*orig)(dirp);
+    }
 
     return dent;
 }