Jim Meyering [Fri, 19 Dec 2003 12:50:33 +0000 (12:50 +0000)]
Don't include <search.h>.
[HAVE_INTTYPES_H]: Include <inttypes.h>.
(tdestroy, tfind, tsearch): Remove definitions.
(struct Active_dir): Rename from `known_object'.
(AD_compare, AD_hash): New functions.
(enter_dir, leave_dir): Rewrite to manipulate a hash table
rather than a tree.
(fts_open): Initialize hash table or cycle_state buffer.
(free_node): Remove function.
(find_matching_ancestor): Renamed/rewritten from look_up_active_dir.
(fts_cross_check): Adapt to use new data structure.
Jim Meyering [Fri, 19 Dec 2003 12:40:05 +0000 (12:40 +0000)]
Include hash.h and cycle-check.h.
(FTS_TIGHT_CYCLE_CHECK): New value.
(FTS_OPTIONMASK): Adjust to include the new value.
(FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value.
(struct FTS) [active_dir_ht]: New member. Replaces fts_dir_signatures.
(struct FTS) [cycle_state]: New member.
Jim Meyering [Thu, 18 Dec 2003 21:11:11 +0000 (21:11 +0000)]
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.
Jim Meyering [Thu, 18 Dec 2003 17:15:38 +0000 (17:15 +0000)]
(format_user): Increment dired_pos via two statements,
`dired_pos += width; dired_pos++;' rather than one,
`dired_pos += width + 1;' since the latter could conceivably overflow.
(format_group): Likewise.
Jim Meyering [Thu, 18 Dec 2003 10:08:32 +0000 (10:08 +0000)]
(AC_SEARCH_LIBS): Remove file/macro, now that
this replacement is no longer needed. Besides, this macro has
no effect with autoconf-2.58, since its `undefine' is not honored.
Jim Meyering [Mon, 8 Dec 2003 08:37:36 +0000 (08:37 +0000)]
(What information is listed, chroot invocation):
Adjust example 'ls' output to match new behavior with narrower
output columns.
(The cut command): Remove example that cut the output of
'ls -l'. The output was incorrect even with the old 'ls', and
the whole idea of using 'cut' on 'ls -l' output is bogus anyway.
Jim Meyering [Mon, 8 Dec 2003 08:34:40 +0000 (08:34 +0000)]
(INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
(format_user_width, format_group_width, unsigned_file_size,
format_group): New functions.
(block_size_width): Renamed from block_size_size.
(inode_number_width, nlink_width, owner_width, group_width,
author_width, major_device_number_width, minor_device_number_width,
file_size_width): New vars.
(clear_files): Initialize them.
(gobble_file): Set them. Don't ceiling block_size_width to 7.
(print_long_file): Use them.
(gobble_file): Use a new local variable 'f' to make the code
smaller and more consistent with other functions.
(format_user): Output to stdout, not to a buffer, so that we
don't have to worry about buffer overrun. Update dired_pos.
(print_long_file): Don't put owner, group, author into buffer;
just print them directly. Don't assume link counts and
major and minor numbers fit into unsigned long int.
From Paul Eggert.