fts: avoid false-positive cycle-detection
authorJim Meyering <meyering@redhat.com>
Sun, 19 Jul 2009 20:33:09 +0000 (22:33 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 19 Jul 2009 20:33:09 +0000 (22:33 +0200)
* lib/fts.c (fts_read): Reinitialize cycle-detection data structures
for each new command line argument.

ChangeLog
lib/fts.c

index 56a6bda..9c78852 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-19  Jim Meyering  <meyering@redhat.com>
+
+       fts: avoid false-positive cycle-detection
+       * lib/fts.c (fts_read): Reinitialize cycle-detection data structures
+       for each new command line argument.
+
 2009-07-19  Bruno Haible  <bruno@clisp.org>
 
        Fix build error on mingw with the modules sys_select and unistd.
index 0cbb9fb..bbcd1ff 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -932,7 +932,9 @@ next:       tmp = p;
                                SET(FTS_STOP);
                                return (NULL);
                        }
+                       free_dir(sp);
                        fts_load(sp, p);
+                       setup_dir(sp);
                        goto check_for_dir;
                }