fts.c
changeset 68 d549894aa6a9
parent 67 abe63a276a36
child 77 49e0babccb23
--- a/fts.c
+++ b/fts.c
@@ -9,6 +9,7 @@
 #include <sys/stat.h>
 
 #include <fts.h>
+#include <errno.h>
 
 int compare (const FTSENT ** a, const FTSENT ** b)
 {
@@ -46,7 +47,8 @@
     }
 
     while ((current = fts_read (fts)) != NULL) {
-        printf ("%s/%s\n", current->fts_path, current->fts_name);
+        if (!errno)
+            printf ("%s/%s\n", current->fts_path, current->fts_name);
     }
 
     if (fts_close (fts) < 0)