* lib/fsusage.c (PROPAGATE_ALL_ONES): Don't assume uintmax_t is
[gnulib.git] / lib / fts-cycle.c
index a5f38ab..669db58 100644 (file)
@@ -18,8 +18,6 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include <config.h>
-
 #include "cycle-check.h"
 #include "hash.h"
 
@@ -142,7 +140,7 @@ leave_dir (FTS *fts, FTSENT *ent)
   else
     {
       FTSENT *parent = ent->fts_parent;
-      if (parent != NULL)
+      if (parent != NULL && 0 <= parent->fts_level)
        CYCLE_CHECK_REFLECT_CHDIR_UP (fts->fts_cycle.state,
                                      *(parent->fts_statp), *st);
     }