From 8cc757279d2780cbaf70c10b8a462a5bff9a68e5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 20 May 2005 22:34:44 +0000 Subject: Split fts into LGPL'ed and GPL'ed parts. --- lib/ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lib') diff --git a/lib/ChangeLog b/lib/ChangeLog index 25787cd0d..4971a47f0 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,34 @@ +2005-05-20 Paul Eggert + + * fts.c: Don't include "cycle-check.h" or "hash.h". + (setup_dir, free_dir): New functions. + (enter_dir, leave_dir): Define trivial + alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE. + (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed. + (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir. + (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir): + Move to fts-cycle.c. + (fts_open): Use setup_dir. + (fts_close): Use free_dir. + (fts_read): Have just one copy of the ENTER_DIR code rather than three. + This adds a label and some gotos, but the alternatives were messier. + Check for memory allocation failure when entering a dir. + (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code. + * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro. + (FTS): New member fts_cycle, that is a union that contains the + old active_dir_ht and cycle_state. All uses changed to mention + fts_cycle.ht and fts_cycle.state. + * fts-cycle.c: New file, containing GPL'ed code migrated out of + fts.c, with the following changes: + (setup_dir, free_dir): New functions. + (enter_dir): Now returns bool. Return true if successful, false + if memory exhausted. All callers changed. + Do not bother partly cleaning up on + memory allocation failure; that is free_dir's job. + However, free ad if hash_insert fails, to avoid memory leak. + (enter_dir, leave_dir): Accommodate change to FTS by inspecting + fts->fts_options to see which union member to use. + 2005-05-20 Jim Meyering * fts.c (fts_open): Remove useless but otherwise harmless malloc call. -- cgit v1.2.3-54-g00ecf