+2009-02-18 Jim Meyering <meyering@redhat.com>
+
+ fts: avoid used-uninitialized error due to recent change
+ * lib/fts.c (fts_read): Guard uses of the new member,
+ parent->fts_n_dirs_remaining, since it's not relevant for
+ the parent of a directory specified on the command-line.
+
2009-02-17 James Youngman <jay@gnu.org>
Bruno Haible <bruno@clisp.org>
if (p->fts_statp->st_size == FTS_STAT_REQUIRED)
{
FTSENT *parent = p->fts_parent;
- if (parent->fts_n_dirs_remaining == 0
+ if (FTS_ROOTLEVEL < p->fts_level
+ /* ->fts_n_dirs_remaining is not valid
+ for command-line-specified names. */
+ && parent->fts_n_dirs_remaining == 0
&& ISSET(FTS_NOSTAT)
&& ISSET(FTS_PHYSICAL)
&& link_count_optimize_ok (parent))
else
{
p->fts_info = fts_stat(sp, p, false);
- if (S_ISDIR(p->fts_statp->st_mode))
- {
- if (parent->fts_n_dirs_remaining)
+ if (S_ISDIR(p->fts_statp->st_mode)
+ && p->fts_level != FTS_ROOTLEVEL
+ && parent->fts_n_dirs_remaining)
parent->fts_n_dirs_remaining--;
- }
}
}
else