Rewrite cycle detection code to work properly.
commit56fef712cfa1e37d91b3c8cb6be3f305d87c0ee7
authorJim Meyering <jim@meyering.net>
Thu, 18 Dec 2003 21:11:11 +0000 (18 21:11 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 18 Dec 2003 21:11:11 +0000 (18 21:11 +0000)
treece1765b55d2c743d52c98244bea0586b5a343b2b
parent628c1e33a6065299e0cb7cf09d4a3824ed1dd21c
Rewrite cycle detection code to work properly.
Add some framework (compiled out by default) to test it.

(Dprintf, ENTER_DIR, LEAVE_DIR): Define.
(add_object): Remove function.  Rewritten as...
(enter_dir): New function.
(leave_dir, free_node): New functions.
(fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR,
as appropriate, before returning.
(look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions.
(fts_stat): Don't perform the cycle check here.
Now it's done via enter_dir.
lib/fts.c