changeset 11722:92457e8bc574

fts: avoid false-positive cycle-detection * lib/fts.c (fts_read): Reinitialize cycle-detection data structures for each new command line argument.
author Jim Meyering <meyering@redhat.com>
date Sun, 19 Jul 2009 22:33:09 +0200
parents 54dacd4ed1a5
children 928845623bf5
files ChangeLog lib/fts.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-19  Jim Meyering  <meyering@redhat.com>
+
+	fts: avoid false-positive cycle-detection
+	* lib/fts.c (fts_read): Reinitialize cycle-detection data structures
+	for each new command line argument.
+
 2009-07-19  Bruno Haible  <bruno@clisp.org>
 
 	Fix build error on mingw with the modules sys_select and unistd.
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -932,7 +932,9 @@
 				SET(FTS_STOP);
 				return (NULL);
 			}
+			free_dir(sp);
 			fts_load(sp, p);
+			setup_dir(sp);
 			goto check_for_dir;
 		}