changeset 6036:14b1cca449ad

(setup_dir, enter_dir, leave_dir, free_dir): Use the hash-table-based cycle-detection code not just when FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL. Reported by James Youngman in <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
author Jim Meyering <jim@meyering.net>
date Sun, 14 Aug 2005 14:45:49 +0000
parents a166800910b5
children 35f27efae044
files lib/fts-cycle.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib/fts-cycle.c
+++ b/lib/fts-cycle.c
@@ -50,7 +50,7 @@
 static bool
 setup_dir (FTS *fts)
 {
-  if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK)
+  if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
     {
       enum { HT_INITIAL_SIZE = 31 };
       fts->fts_cycle.ht = hash_initialize (HT_INITIAL_SIZE, NULL, AD_hash,
@@ -74,7 +74,7 @@
 static bool
 enter_dir (FTS *fts, FTSENT *ent)
 {
-  if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK)
+  if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
     {
       struct stat const *st = ent->fts_statp;
       struct Active_dir *ad = malloc (sizeof *ad);
@@ -125,7 +125,7 @@
 static void
 leave_dir (FTS *fts, FTSENT *ent)
 {
-  if (fts->fts_options & FTS_TIGHT_CYCLE_CHECK)
+  if (fts->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
     {
       struct stat const *st = ent->fts_statp;
       struct Active_dir obj;
@@ -144,7 +144,7 @@
 static void
 free_dir (FTS *sp)
 {
-  if (sp->fts_options & FTS_TIGHT_CYCLE_CHECK)
+  if (sp->fts_options & (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
     {
       if (sp->fts_cycle.ht)
 	hash_free (sp->fts_cycle.ht);