p->fts_statp may not yet be defined.
(fts_read): Instead, set it in the caller, once p->fts_statp is
sure to be defined, and corresponds to a top-level directory.
+2006-12-03 Jim Meyering <jim@meyering.net>
+
+ * lib/fts.c (fts_load): Don't set sp->fts_dev here, since
+ p->fts_statp may not yet be defined.
+ (fts_read): Instead, set it in the caller, once p->fts_statp is
+ sure to be defined, and corresponds to a top-level directory.
+
2006-12-01 Jim Meyering <jim@meyering.net>
* modules/savewd (Depends-on): Add fcntl_h to avoid self-test
p->fts_namelen = len;
}
p->fts_accpath = p->fts_path = sp->fts_path;
- sp->fts_dev = p->fts_statp->st_dev;
}
int
abort ();
}
}
+
sp->fts_cur = p;
if (p->fts_info == FTS_D)
{
+ /* Now that P->fts_statp is guaranteed to be valid,
+ if this is a command-line directory, record its
+ device number, to be used for FTS_XDEV. */
+ if (p->fts_level == FTS_ROOTLEVEL)
+ sp->fts_dev = p->fts_statp->st_dev;
Dprintf ((" entering: %s\n", p->fts_path));
if (! enter_dir (sp, p))
{