Jim Meyering [Thu, 1 Nov 2001 15:51:53 +0000 (15:51 +0000)]
(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.
Jim Meyering [Thu, 1 Nov 2001 11:31:26 +0000 (11:31 +0000)]
*** empty log message ***
Jim Meyering [Thu, 1 Nov 2001 11:31:19 +0000 (11:31 +0000)]
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.
Jim Meyering [Thu, 1 Nov 2001 10:56:41 +0000 (10:56 +0000)]
*** empty log message ***
Jim Meyering [Thu, 1 Nov 2001 10:56:25 +0000 (10:56 +0000)]
(TESTS): Add dired.
Jim Meyering [Thu, 1 Nov 2001 10:43:23 +0000 (10:43 +0000)]
Don't try to print a NULL pointer.
(main): Don't use ARGMATCH_TO_ARGUMENT.
This reverts part of the 1998-12-31 change.
Jim Meyering [Sun, 28 Oct 2001 10:01:07 +0000 (10:01 +0000)]
update copyright year
Jim Meyering [Sun, 28 Oct 2001 09:40:57 +0000 (09:40 +0000)]
*** empty log message ***
Jim Meyering [Sun, 28 Oct 2001 09:40:25 +0000 (09:40 +0000)]
.
Jim Meyering [Sun, 28 Oct 2001 09:39:52 +0000 (09:39 +0000)]
test Paul's fix
Jim Meyering [Sun, 28 Oct 2001 09:39:26 +0000 (09:39 +0000)]
(TESTS): Add sysv.
Jim Meyering [Sun, 28 Oct 2001 08:31:39 +0000 (08:31 +0000)]
*** empty log message ***
Jim Meyering [Sun, 28 Oct 2001 08:31:08 +0000 (08:31 +0000)]
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.
Jim Meyering [Sun, 28 Oct 2001 08:26:53 +0000 (08:26 +0000)]
*** empty log message ***
Jim Meyering [Sun, 28 Oct 2001 08:20:01 +0000 (08:20 +0000)]
*** empty log message ***
Jim Meyering [Sat, 27 Oct 2001 16:43:52 +0000 (16:43 +0000)]
*** empty log message ***
Jim Meyering [Sat, 27 Oct 2001 14:24:56 +0000 (14:24 +0000)]
*** empty log message ***
Jim Meyering [Sat, 27 Oct 2001 14:24:42 +0000 (14:24 +0000)]
Give an accurate diagnostic when `head --bytes=30M' fails.
(string_to_integer): Check explicitly for overflow,
and lump everything else together as `invalid'.
Jim Meyering [Wed, 24 Oct 2001 10:38:53 +0000 (10:38 +0000)]
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.
Jim Meyering [Wed, 24 Oct 2001 07:38:33 +0000 (07:38 +0000)]
*** empty log message ***
Jim Meyering [Wed, 24 Oct 2001 07:38:26 +0000 (07:38 +0000)]
(main): Free hash table storage.
Jim Meyering [Wed, 24 Oct 2001 07:36:53 +0000 (07:36 +0000)]
(forget_all): Use hash_free, not hash_clear.
Jim Meyering [Mon, 22 Oct 2001 08:02:38 +0000 (08:02 +0000)]
.
Jim Meyering [Mon, 22 Oct 2001 08:02:09 +0000 (08:02 +0000)]
*** empty log message ***
Jim Meyering [Mon, 22 Oct 2001 08:01:43 +0000 (08:01 +0000)]
(alloca): Define to __builtin_alloca if __GNUC__,
to avoid a warning if -Wall.
Jim Meyering [Mon, 22 Oct 2001 08:01:22 +0000 (08:01 +0000)]
(alloca): Define to __builtin_alloca if __GNUC__,
to avoid a warning if -Wall.
Jim Meyering [Mon, 22 Oct 2001 06:56:44 +0000 (06:56 +0000)]
*** empty log message ***
Jim Meyering [Mon, 22 Oct 2001 06:56:31 +0000 (06:56 +0000)]
(uintptr_t): Remove macro and decl; it's config.h's job.
Jim Meyering [Sun, 21 Oct 2001 21:46:09 +0000 (21:46 +0000)]
.
Jim Meyering [Sun, 21 Oct 2001 19:52:12 +0000 (19:52 +0000)]
(isaac_seed_machdep): Handle SIGSEGV, too. Ick.
Jim Meyering [Sun, 21 Oct 2001 18:50:16 +0000 (18:50 +0000)]
yikes. put the preserve_metadata assignment *after* declarations.
gcc-3.0 didn't complain.
Jim Meyering [Sun, 21 Oct 2001 17:06:36 +0000 (17:06 +0000)]
.
Jim Meyering [Sun, 21 Oct 2001 17:03:50 +0000 (17:03 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 17:03:31 +0000 (17:03 +0000)]
(TESTS): Remove i-3. It's not portable.
Jim Meyering [Sun, 21 Oct 2001 15:21:34 +0000 (15:21 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 15:21:28 +0000 (15:21 +0000)]
Include xreadlink.h.
(copy_internal): Don't use PATH_MAX.
Rewrite the symlink-copying code to use xreadlink.
Jim Meyering [Sun, 21 Oct 2001 15:12:39 +0000 (15:12 +0000)]
whoops! fix comment on first line :-)
Jim Meyering [Sun, 21 Oct 2001 13:39:20 +0000 (13:39 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 13:39:12 +0000 (13:39 +0000)]
(_): Honor the setting of ENABLE_NLS. Otherwise,
this code would end up calling gettext even in packages built
with --disable-nls.
Jim Meyering [Sun, 21 Oct 2001 12:33:26 +0000 (12:33 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 12:33:21 +0000 (12:33 +0000)]
(cp invocation): Describe --reply=...
Jim Meyering [Sun, 21 Oct 2001 10:55:36 +0000 (10:55 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 10:55:29 +0000 (10:55 +0000)]
(_): Honor the setting of ENABLE_NLS. Otherwise,
this code would end up calling gettext even in packages built
with --disable-nls.
Jim Meyering [Sun, 21 Oct 2001 09:01:31 +0000 (09:01 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 09:01:24 +0000 (09:01 +0000)]
(_): Honor the setting of ENABLE_NLS. Otherwise,
this code would end up calling gettext even in packages built
with --disable-nls.
Jim Meyering [Sun, 21 Oct 2001 07:59:09 +0000 (07:59 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 07:59:04 +0000 (07:59 +0000)]
(strerror_r): Do not declare unless !_LIBC.
Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
Use strerror_r that is only a macro, even if it is not a function.
(strerror): Check for HAVE_DECL_STRERROR before declaring.
(private_strerror): Use prototypes, not old-style function definition.
(print_errno_message): New function.
Support the POSIX 'int'-flavored strerror_r, as well as the traditional
char*-flavored one.
(error_tail, error, error_at_line): Use it.
Jim Meyering [Sun, 21 Oct 2001 07:49:37 +0000 (07:49 +0000)]
*** empty log message ***
Jim Meyering [Sun, 21 Oct 2001 07:49:27 +0000 (07:49 +0000)]
(jm_PREREQ_ERROR):
Do not invoke AC_CHECK_FUNCS with strerror_r, as
AC_FUNC_STRERROR_R does that.
Jim Meyering [Sun, 21 Oct 2001 07:49:13 +0000 (07:49 +0000)]
Add copyright notice, as nontrivial m4 files
are supposed to have them these days.
(AC_FUNC_STRERROR_R): Always do char* test, so that it gets cached.
Merge changes from latest Autoconf CVS.
Rename ac_cv_func_strerror_r_works to ac_cv_func_strerror_r_char_p,
and rename HAVE_WORKING_STRERROR_R to STRERROR_R_CHAR_P, since
POSIX decided to standardize on the int flavor of strerror_r.
Jim Meyering [Sat, 20 Oct 2001 19:13:41 +0000 (19:13 +0000)]
*** empty log message ***
Jim Meyering [Sat, 20 Oct 2001 14:59:07 +0000 (14:59 +0000)]
*** empty log message ***
Jim Meyering [Sat, 20 Oct 2001 14:58:59 +0000 (14:58 +0000)]
(usage): Improve the description of --dereference (-L).
Jim Meyering [Sat, 20 Oct 2001 14:57:39 +0000 (14:57 +0000)]
Declare some local variables to be `const', where appropriate.
Jim Meyering [Sat, 20 Oct 2001 14:54:07 +0000 (14:54 +0000)]
*** empty log message ***
Jim Meyering [Sat, 20 Oct 2001 14:53:45 +0000 (14:53 +0000)]
(usage): Clarify description of --directory (-d).
Based on a patch from Michael Stone.
Jim Meyering [Sat, 20 Oct 2001 14:41:31 +0000 (14:41 +0000)]
*** empty log message ***
Jim Meyering [Sat, 20 Oct 2001 14:41:23 +0000 (14:41 +0000)]
tweak
Jim Meyering [Sat, 20 Oct 2001 14:40:12 +0000 (14:40 +0000)]
Describe sticky files and directories.
Jim Meyering [Sat, 20 Oct 2001 14:01:33 +0000 (14:01 +0000)]
*** empty log message ***
Jim Meyering [Sat, 20 Oct 2001 14:01:23 +0000 (14:01 +0000)]
Don't use a umask that removes owner read/write.
Use a stricter test for permissions.
Jim Meyering [Sat, 20 Oct 2001 13:59:57 +0000 (13:59 +0000)]
Don't use a umask that removes owner
read/write. That induces spurious failures in a probably-old
version of purify.
Jim Meyering [Thu, 18 Oct 2001 20:29:57 +0000 (20:29 +0000)]
split a long line into two
Jim Meyering [Thu, 18 Oct 2001 08:14:45 +0000 (08:14 +0000)]
*** empty log message ***
Jim Meyering [Thu, 18 Oct 2001 08:13:28 +0000 (08:13 +0000)]
(movefile): Now that remember_copied xstrdup's the file name, free `new_dest'.
Jim Meyering [Thu, 18 Oct 2001 07:45:00 +0000 (07:45 +0000)]
*** empty log message ***
Jim Meyering [Thu, 18 Oct 2001 07:44:41 +0000 (07:44 +0000)]
Plug a leak.
(remember_copied): Use src_to_dest_free to free the entry we couldn't insert.
Jim Meyering [Thu, 18 Oct 2001 07:42:11 +0000 (07:42 +0000)]
(dest_info_free): New function.
(dest_info_init): Make the hash table code use it.
(record_dest): Store each DEST in malloc'd memory. Hence the above.
Use dest_info_free to free the `ent' we couldn't insert.
Jim Meyering [Wed, 17 Oct 2001 10:24:13 +0000 (10:24 +0000)]
*** empty log message ***
Jim Meyering [Wed, 17 Oct 2001 10:24:07 +0000 (10:24 +0000)]
(cp invocation): `cp --no-dereference' is
no longer equivalent to `cp -d'.
`cp -d' is equivalent to `--no-dereference --preserve=links'.
cp's -P option means --no-dereference, not --parents.
Describe new optional argument to --preserve.
Describe new option: --no-preserve=ATTRIBUTE_LIST.
Jim Meyering [Wed, 17 Oct 2001 10:14:28 +0000 (10:14 +0000)]
*** empty log message ***
Jim Meyering [Wed, 17 Oct 2001 10:11:52 +0000 (10:11 +0000)]
*** empty log message ***
Jim Meyering [Sun, 14 Oct 2001 20:55:02 +0000 (20:55 +0000)]
*** empty log message ***
Jim Meyering [Sun, 14 Oct 2001 20:54:44 +0000 (20:54 +0000)]
Now, -P is the same as --no-dereference, per POSIX.
Use --parents to get the old meaning.
(enum) [NO_DEREFERENCE_OPTION]: Remove member.
(long_opts): Associate --no-dereference with `-P'.
(usage): Update description of -P.
(main): Remove local, used_P_option, and code to warn
that the meaning of -P would be changing.
Jim Meyering [Sat, 13 Oct 2001 21:42:16 +0000 (21:42 +0000)]
.
Jim Meyering [Sat, 13 Oct 2001 20:53:41 +0000 (20:53 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 20:53:36 +0000 (20:53 +0000)]
(copy_internal): Tighten up and add comments
describing the test for when to record (via remember_copied)
a <dst_path, source_dev, source_ino> triple.
Relax the test that guards the hard-linked-dir check and
the hard-link-preserving code.
Jim Meyering [Sat, 13 Oct 2001 20:44:59 +0000 (20:44 +0000)]
add tests for some of the recent changes to cp
Jim Meyering [Sat, 13 Oct 2001 19:58:41 +0000 (19:58 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 19:57:08 +0000 (19:57 +0000)]
(enum) [NO_DEREFERENCE_OPTION]: New member.
(enum) [NO_PRESERVE_ATTRIBUTES_OPTION]: New member.
(enum) [PRESERVE_ATTRIBUTES_OPTION]: New member.
(long_opts): Separate -d and --no-dereference options.
Add `no-preserve'.
Separate -p and --preserve options.
The long-named --preserve now accepts optional arguments; -p doesn't.
(usage): Describe additions and changes.
(cp_option_init): Initialize new member, preserve_links, to 0.
(decode_preserve_arg): New function.
(main) [case 'a']: Set preserve_links to 1.
[case 'd']: Set preserve_links to 1.
Add `case' for long-named --no-dereference.
Handle long-named --no-preserve and --preserve.
Jim Meyering [Sat, 13 Oct 2001 19:41:17 +0000 (19:41 +0000)]
(cp_option_init): Initialize new member to 1.
Jim Meyering [Sat, 13 Oct 2001 19:40:31 +0000 (19:40 +0000)]
(cp_option_init): Initialize new member, preserve_links.
Jim Meyering [Sat, 13 Oct 2001 19:36:26 +0000 (19:36 +0000)]
(enum Dereference_symlink): Add comments.
(struct cp_options) [preserve_links]: New member.
Jim Meyering [Sat, 13 Oct 2001 19:13:16 +0000 (19:13 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 19:12:52 +0000 (19:12 +0000)]
(cp_option_init): Don't set it.
Jim Meyering [Sat, 13 Oct 2001 19:12:06 +0000 (19:12 +0000)]
(struct cp_options) [failed_unlink_is_fatal]: Remove unused member.
Jim Meyering [Sat, 13 Oct 2001 17:25:17 +0000 (17:25 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 17:24:38 +0000 (17:24 +0000)]
* src/copy.h (struct cp_options): Rename members:
s/preserve_owner_and_group/preserve_ownership/, and
s/preserve_chmod_bits/preserve_mode/.
* src/copy.c, src/cp.c, src/install.c, src/mv.c: Update all uses.
Jim Meyering [Sat, 13 Oct 2001 17:24:09 +0000 (17:24 +0000)]
* src/copy.h (struct cp_options): Rename members:
s/preserve_owner_and_group/preserve_ownership/, and
s/preserve_chmod_bits/preserve_mode/.
* src/copy.c, src/cp.c, src/install.c, src/mv.c: Update all uses.
Jim Meyering [Sat, 13 Oct 2001 17:23:44 +0000 (17:23 +0000)]
(struct cp_options): Rename members:
s/preserve_owner_and_group/preserve_ownership/, and
s/preserve_chmod_bits/preserve_mode/.
Jim Meyering [Sat, 13 Oct 2001 16:54:18 +0000 (16:54 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 16:51:09 +0000 (16:51 +0000)]
*** empty log message ***
Jim Meyering [Sat, 13 Oct 2001 16:50:59 +0000 (16:50 +0000)]
Fix typo: s/Sh/SH/ before OPTIONS.
Jim Meyering [Fri, 12 Oct 2001 21:47:06 +0000 (21:47 +0000)]
don't use diff
Jim Meyering [Fri, 12 Oct 2001 07:03:12 +0000 (07:03 +0000)]
*** empty log message ***
Jim Meyering [Fri, 12 Oct 2001 07:03:04 +0000 (07:03 +0000)]
(TESTS): Add infloop.
(XFAIL_TESTS): Mark it as a test that we expect to fail (temporarily).
Jim Meyering [Fri, 12 Oct 2001 06:33:55 +0000 (06:33 +0000)]
*** empty log message ***
Jim Meyering [Fri, 12 Oct 2001 06:32:13 +0000 (06:32 +0000)]
(main): Tell what's wrong with `mknod c zero 1 5' rather
than saying just `Try `./mknod --help' for more information.'.
Jim Meyering [Thu, 11 Oct 2001 15:52:22 +0000 (15:52 +0000)]
*** empty log message ***
Jim Meyering [Thu, 11 Oct 2001 15:52:17 +0000 (15:52 +0000)]
(argmatch_invalid): Use quotearg_n_style (0, ...
and quote_n (1, ... to avoid clobbering a buffer.