diff --git a/fts.c b/fts.c --- a/fts.c +++ b/fts.c @@ -9,6 +9,7 @@ #include #include +#include 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)