Commit Graph
22888 Commits
Author SHA1 Message Date
Jim Meyering 81679a0c34 Use XMALLOC in a several places. It's cleaner. 2001-11-02 07:38:56 +00:00
Jim Meyering 3e06bb8549 put `const' back, now that the .m4 test works 2001-11-02 07:37:19 +00:00
Jim Meyering a427fa83f6 Use the replacement only if we have neither the function
nor a declaration.
2001-11-02 07:36:35 +00:00
Jim Meyering 594350107d remove const 2001-11-01 22:16:43 +00:00
Jim Meyering d73c55e449 whoops 2001-11-01 22:14:26 +00:00
Jim Meyering f8b38d358b *** empty log message *** 2001-11-01 21:40:07 +00:00
Jim Meyering 6fa5979ccb Include dirfd.h.
(print_dir): If dirfd fails, resort to using stat.
2001-11-01 21:40:01 +00:00
Jim Meyering 866d4b9e59 . 2001-11-01 17:58:23 +00:00
Jim Meyering 24e2617917 *** empty log message *** 2001-11-01 17:58:09 +00:00
Jim Meyering 533999f0fe (libfetish_a_SOURCES): Add dirfd.h. 2001-11-01 17:57:56 +00:00
Jim Meyering eaa95f208b . 2001-11-01 17:57:09 +00:00
Jim Meyering 9d874c09f6 *** empty log message *** 2001-11-01 17:44:43 +00:00
Jim Meyering b701bf8a30 *** empty log message *** 2001-11-01 16:57:18 +00:00
Jim Meyering 7c102d03c7 use AC_HEADER_DIRECT and all the associated cruft 2001-11-01 16:55:16 +00:00
Jim Meyering 0c0ad8da77 don't indent the #include directive 2001-11-01 16:47:00 +00:00
Jim Meyering 8d503b5362 check for decl, too 2001-11-01 16:46:06 +00:00
Jim Meyering 274003219b *** empty log message *** 2001-11-01 16:43:02 +00:00
Jim Meyering 0bba57ce8c (jm_MACROS): Require UTILS_FUNC_DIRFD. 2001-11-01 16:42:53 +00:00
Jim Meyering afd8381b51 (UTILS_FUNC_DIRFD): New macro. 2001-11-01 16:41:57 +00:00
Jim Meyering 76ffae0660 *** empty log message *** 2001-11-01 15:55:59 +00:00
Jim Meyering 74b63f68dd (hash_print) [TESTING]: Clean up. 2001-11-01 15:55:53 +00:00
Jim Meyering 85431d93ed Redirect cmp's stderr to /dev/null. 2001-11-01 15:54:36 +00:00
Jim Meyering 186af758eb *** empty log message *** 2001-11-01 15:52:27 +00:00
Jim Meyering c4dbc53ec4 (struct pending) [st_ino, st_dev]: Remove just-added members.
(queue_directory): Remove just-added 3rd parameter
and associated code, and update callers.
(print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...',
and call visit_dir to detect cycles here.
Push the dev/inode pair onto the new stack.
(dev_ino_obstack): New global.
(DEV_INO_PUSH): New macro.
(dev_ino_pop): New function.
(ASSERT_MATCHING_DEV_INO): New macro.
(visit_dir): Take two parameters (dev,ino), not one `pending'.
(main): Initialized the dev_ino_obstack.
Don't call visit_dir here.
Get the dev/ino pair from the new stack, not from the pending entry.
2001-11-01 15:51:53 +00:00
Jim Meyering 00fc6c9262 *** empty log message *** 2001-11-01 11:31:26 +00:00
Jim Meyering 9e2756872d Make ls -R detect directory cycles.
Include hash.h, same.h, and xalloc.h.
(INITIAL_TABLE_SIZE, LOOP_DETECT): Define.
(active_dir_set): New global.
(struct dev_ino): Declare.
(dev_ino_hash, dev_ino_compare, dev_ino_free): New functions.
(visit_dir, free_pending_ent): New functions.
(main): Initialize the active_dir_set hash table, if necessary.
Don't confuse a marker entry with a real one.
Detect loops.
Manage the set of active directories.
Free the hash table.
(queue_directory): Add a new parameter.
Ensure that we set the new dev/ino members for each enqueued directory.
Update all callers.
(print_dir): Don't confuse a marker entry with a real one.
(extract_dirs_from_files): Insert a marker entry before inserting
the entries for subdirectories.
2001-11-01 11:31:19 +00:00
Jim Meyering c1c9a579e3 *** empty log message *** 2001-11-01 10:56:41 +00:00
Jim Meyering e3f8ccf486 (TESTS): Add dired. 2001-11-01 10:56:25 +00:00
Jim Meyering 3eeda5b2bf Don't try to print a NULL pointer.
(main): Don't use ARGMATCH_TO_ARGUMENT.
This reverts part of the 1998-12-31 change.
2001-11-01 10:43:23 +00:00
Jim Meyering 09edea7381 update copyright year 2001-10-28 10:01:07 +00:00
Jim Meyering 02da289e42 *** empty log message *** 2001-10-28 09:40:57 +00:00
Jim Meyering 6d81e0f580 . 2001-10-28 09:40:25 +00:00
Jim Meyering 1c7b8f6e85 test Paul's fix 2001-10-28 09:39:52 +00:00
Jim Meyering af6ce0f12c (TESTS): Add sysv. 2001-10-28 09:39:26 +00:00
Jim Meyering 904404bfd2 *** empty log message *** 2001-10-28 08:31:39 +00:00
Jim Meyering a4d1bdafd6 Include human.h.
(ROTATE_RIGHT): Remove; it was slow and the comment was
misleading anyway.
(bsd_sum_file): Avoid unsigned and long when they're not needed.
Compute total input bytes as uintmax_t, not long, so that the
code works even with files whose size does not fit in 'long'.
(sysv_sum_file): Likewise.
(sysv_sum_file): Do not reduce checksum until the end; this is
what System V does.
2001-10-28 08:31:08 +00:00
Jim Meyering e922107a25 *** empty log message *** 2001-10-28 08:26:53 +00:00
Jim Meyering 8e763221fd *** empty log message *** 2001-10-28 08:20:01 +00:00
Jim Meyering df5b9c4dc3 *** empty log message *** 2001-10-27 16:43:52 +00:00
Jim Meyering cda8d2a9af *** empty log message *** 2001-10-27 14:24:56 +00:00
Jim Meyering 58b5f108f2 Give an accurate diagnostic when `head --bytes=30M' fails.
(string_to_integer): Check explicitly for overflow,
and lump everything else together as `invalid'.
2001-10-27 14:24:42 +00:00
Jim Meyering 93a207af8d Remove as many instances of 'unsigned' as
possible, as some of them were not conforming to ANSI C, and
they made the code hard to read.  Avoiding 'unsigned' cuts
down on the number of casts.

(newline_character, space_character, save_char):
Now char, not unsigned char.
(obuf): Now char *, not unsigned char *.
(ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii):
Now char[], not unsigned char[].
(translate_charset, translate_buffer, swab_buffer, skip, copy_simple,
copy_with_block, copy_with_unblock):
Arg now points to char, not unsigned char.
All callers changed.
(translate_charset, parse_conversion, apply_translations):
Use int index, not unsigned int.
(bit_count): Arg is now int, not unsigned int.
Callers not changed, as they already assumed this.
(translate_buffer): Cast char to unsigned char before using
it as a subscript.
(swab_buffer): Returns char *, not unsigned char *.
(dd_copy): Use char, not unsigned char, for buffers.
Use size_t for possibly-large index, not unsigned int.
2001-10-24 10:38:53 +00:00
Jim Meyering fd77bc4a78 *** empty log message *** 2001-10-24 07:38:33 +00:00
Jim Meyering 1e2d216c9e (main): Free hash table storage. 2001-10-24 07:38:26 +00:00
Jim Meyering df1b3c4948 (forget_all): Use hash_free, not hash_clear. 2001-10-24 07:36:53 +00:00
Jim Meyering 0b765fd547 . 2001-10-22 08:02:38 +00:00
Jim Meyering 8229e0dbef *** empty log message *** 2001-10-22 08:02:09 +00:00
Jim Meyering 05c446084e (alloca): Define to __builtin_alloca if __GNUC__,
to avoid a warning if -Wall.
2001-10-22 08:01:43 +00:00
Jim Meyering e28263f673 (alloca): Define to __builtin_alloca if __GNUC__,
to avoid a warning if -Wall.
2001-10-22 08:01:22 +00:00
Jim Meyering b96c3e6a5d *** empty log message *** 2001-10-22 06:56:44 +00:00