summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-12 13:02:01 +0000
committerJim Meyering <jim@meyering.net>2005-08-12 13:02:01 +0000
commitfe90fa6a61fbaa3d1f12d18016076a0ac7559bf0 (patch)
tree4b0963cacf75a8ad84ae01a4b1b4d4e26e081756 /lib
parent6806c6a8011cf9899e56fd2b8a10794956246036 (diff)
downloadcoreutils-fe90fa6a61fbaa3d1f12d18016076a0ac7559bf0.tar.xz
(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>.
Diffstat (limited to 'lib')
-rw-r--r--lib/fts-cycle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/fts-cycle.c b/lib/fts-cycle.c
index 0fb1a03c7..8c09fb948 100644
--- a/lib/fts-cycle.c
+++ b/lib/fts-cycle.c
@@ -50,7 +50,7 @@ AD_hash (void const *x, size_t table_size)
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 @@ setup_dir (FTS *fts)
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 @@ enter_dir (FTS *fts, FTSENT *ent)
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 @@ leave_dir (FTS *fts, FTSENT *ent)
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);