Age | Commit message (Collapse) | Author |
|
(src_info_init): New function.
(copy_internal): Warn and return early for the second and subsequent
occurrences of the same source file named on the command line.
|
|
(copy_internal): Update caller.
|
|
(seen_file): Rename from seen_dest. Rename parameters accordingly.
(record_file): Rename from record_dest. Rename parameters accordingly.
(triple_hash): Rename from dest_info_hash.
(triple_compare): Rename from dest_info_compare.
(triple_free): Rename from dest_info_free.
|
|
(dest_info): Remove declaration of file-scoped global.
(dest_info_init): Require a parameter.
Update all callers.
(seen_dest): Require a hash table parameter. Update callers.
(record_dest): Likewise.
|
|
gcc-3.0 didn't complain.
|
|
(copy_internal): Don't use PATH_MAX.
Rewrite the symlink-copying code to use xreadlink.
|
|
(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.
|
|
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.
|
|
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.
|
|
file name, free the temporary `dst_path' allocated here.
|
|
Thank heavens for regression tests.
|
|
(copy_internal): Call remember_copied only for if the source file
has 1 < st_nlink, or if it's a directory.
Now that EARLIER_FILE is set conditionally, initialize it to NULL.
|
|
|
|
files (for which this makes sense), not just regular ones.
|
|
(struct Dest_info): Define.
(dest_info): Declare global.
(DEST_INFO_INITIAL_CAPACITY): Define.
(hash_pjw): New function.
(dest_info_hash): Likewise.
(dest_info_compare): Likewise.
(dest_info_init): Likewise.
(seen_dest): Likewise.
(record_dest): Likewise.
(copy_internal): If the destination exists, fail if it's in the set
of files that have already been created as part of this mv or cp.
(copy_internal) [move_mode]: Record the destination dev/ino/filename.
(copy_internal) [!move_mode, regular file]: Likewise.
|
|
(copy_internal): Rename parameter, move_mode, to
command_line_arg, and adjust caller. Now, move_mode is a local
that is derived from command_line_arg.
Factor some involved code to produce something slightly more readable.
Use x->move_mode, not move_mode in determining which diagnostic
to give (`backing up %s would destroy source; %s not moved').
|
|
(copy_internal): Use UNWRITABLE.
|
|
--reply=... option.
|
|
if-block. This fixes a bug introduced by my 2001-08-06 change.
|
|
|
|
(full_write): Remove decl; not needed.
(copy_reg): Don't assume read and write size fits in int.
|
|
(copy_internal): Separate the mv-specific and non-move_mode code
that determines whether to prompt the user.
[move_mode]: Don't make mv fail (i.e. don't return 1) just because
the user declined to remove one or more of the files.
|
|
the caller (mv) doesn't remove the source file.
|
|
|
|
when copying (i.e., not in move mode) and not preserving permissions.
|
|
dir_name return value. That can't happen.
|
|
|
|
don't remove the symlink. Reported by David Luyer as Debian bug#82089,
via Michael Stone.
|
|
Set *copy_into_self in the new code that detects that.
Make diagnostic more consistent: s/won't/will not/.
[move_mode, copy_into_self]: Give a diagnstic here, now that
we have the top_level_* globals. Remove the corresponding diagnostic
from mv.c.
Add a FIXME comment.
|
|
across a partition boundary) to overwrite a non-directory with a directory.
|
|
|
|
(copy_internal): Use them.
(copy): Set them.
|
|
(same_file_ok): Use stat only if lstat reported that
the file was a symbolic link.
|
|
|
|
|
|
s/tmp_dst_sb/tmp_src_sb/.
|
|
|
|
tmp_dst_sb, instead of two static vars.
Likewise for tmp_src_sb.
|
|
variables: src_sb_no_link, dst_sb_no_link.
|
|
using --remove-dest with -R.
|
|
preceding chown call and we're supposed to preserve some special
permission bit(s) that would have been reset by chown.
Reported by Greg Louis.
|
|
(copy_internal): Avoid calling chown if we know it's not necessary.
|
|
|
|
|
|
|
|
checkpoint
|
|
and partially rewritten.
(copy_internal): Unlink destination file when unlink_dest_before_opening
option is set, and when the source is neither a regular file nor a directory.
|
|
Remove the SPARSE_MODE parameter. Update caller.
Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when
the regular destination file exists; upon failure, unlink
that existing file, then open again, but with O_WRONLY|O_CREAT.
(copy_internal): `force' in not related to interactive; remove
the conjunct.
Remove the entire `else if (x->force)' block; justifying
removal of the non-directory part is easy: POSIX requires we try
to open an existing regular file, so we can't unlink it beforehand.
The part that changes the mode on a directory to allow overwriting
isn't necessary.
|
|
since we then unlink the destination file.
|
|
|