Mercurial > hg > octave-lyh > gnulib-hg
changeset 7499:67ce0bed0a20
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.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 14 Oct 2006 06:32:48 +0000 |
parents | ec08a52e7d4f |
children | 90934904573f |
files | ChangeLog lib/fts.c |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +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
--- a/lib/fts.c +++ b/lib/fts.c @@ -396,7 +396,10 @@ 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 {