* lib/fts.c (fts_open): When using FTS_XDEV|FTS_NOSTAT,
p->fts_statp->st_dev would be used uninitialized.
Ensures that we always call fts_stat on the very first entry.
Miklos Szeredi reported that find -xdev stopped working.
+2006-10-13 Jim Meyering <jim@meyering.net>
+
+ Fix a bug in yesterday's change.
+ * lib/fts.c (fts_open): When using FTS_XDEV|FTS_NOSTAT,
+ p->fts_statp->st_dev would be used uninitialized.
+ Ensures that we always call fts_stat on the very first entry.
+ Miklos Szeredi reported that find -xdev stopped working.
+
2006-10-12 Bruno Haible <bruno@clisp.org>
* gnulib-tool (func_get_automake_snippet): Append an automatically
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;
p->fts_accpath = p->fts_name;
- if (defer_stat) {
+ /* Even when defer_stat is true, be sure to stat the first
+ command line argument, since fts_read (at least with
+ FTS_XDEV) requires that. */
+ if (defer_stat && root != NULL) {
p->fts_info = FTS_NSOK;
fts_set_stat_required(p, true);
} else {