summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2000-09-07Remove obsolete comment block.Jim Meyering
2000-09-04Remove declaration of lstat, now that it's in copy.h.Jim Meyering
2000-09-04Move declaractions of lstat, stat, and rpl_lstatJim Meyering
as well as the definition of lstat from cp.c to this file.
2000-09-04Move declaractions of lstat, stat, and rpl_lstatJim Meyering
as well as the definition of lstat from here to copy.h.
2000-09-04(do_link): Tweak diagnostics.Jim Meyering
2000-09-04(same_file_ok): Hoist a test.Jim Meyering
2000-09-04factor out backup/same test, put it after if-else.Jim Meyering
2000-09-04(same_file_ok): factor some more. improve -- now passes all tests.Jim Meyering
checkpoint
2000-09-03(cp_option_init): Initialize new members.Jim Meyering
2000-09-03Remove obsolete comment block.Jim Meyering
(cp_option_init): Initialize new members. (usage): Reflect the fact that --force (-f) relates only to whether mv prompts. (main): Remove uses of old `force' option member.
2000-09-03(enum): Add UNLINK_DEST_BEFORE_OPENING.Jim Meyering
[long_options]: Add an entry for --remove-destination. (usage): Describe --remove-destination. (do_copy): Use unlink_dest_after_failed_open member, not `force.' (cp_option_init): Initialize new members. (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination).
2000-09-03correct description of unlink_dest_after_failed_openJim Meyering
2000-09-03commentJim Meyering
2000-09-03Use strcoll (not strcmp) when comparing file names.Jim Meyering
2000-09-03(struct cp_options) [force]: Remove member.Jim Meyering
[unlink_dest_before_opening]: Add member. [unlink_dest_after_failed_open]: Add member.
2000-09-03(same_file_ok): New function, extracted from copy_internal,Jim Meyering
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.
2000-08-27(copy_reg): New parameters: X and NEW_DST.Jim Meyering
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.
2000-08-27(copy_internal): Set `new_dst' when the move_mode rename fails,Jim Meyering
since we then unlink the destination file.
2000-08-27(copy_reg): Rename two goto labels.Jim Meyering
2000-08-26(usage): --force is independent of --interactive.Jim Meyering
2000-08-24Put back the kluge. It's necessary after all.Jim Meyering
(buggy_lseek_support): New function. (skip): Use it. Frank Adler reported that although _llseek returns 0, lseek erroneously returns an offset suggesting the operation succeeded even though it fails.
2000-08-24(skip): Assume lseek failed if it returned zero, since a zero return isJim Meyering
impossible and some buggy drivers return zero. Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the file descriptor is not currently rewound.
2000-08-23Include <config.h> unconditionally, to be consistentJim Meyering
with all the other programs in this directory.
2000-08-23back out last changeJim Meyering
2000-08-22Don't even try to use lseek on character devices.Jim Meyering
(buggy_lseek_support): New function. (skip): Use it. Reported by Martin Gallant via Michael Stone.
2000-08-20(cp_option_init): Initialize to DEREF_ALWAYS, not `1'.Jim Meyering
2000-08-20(cp_option_init): Initialize to DEREF_NEVER, not `0'.Jim Meyering
2000-08-20(long_opts): Add --dereference, -L.Jim Meyering
(usage): Describe -L and -H. (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'. (main): Add `H' and `-L' to getopt spec string. [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0. [case 'd']: Likewise. [case 'H']: New case. [case 'L']: New case. [case 'R']: Don't set dereference to `0' here. If it's not yet defined, set x.dereference to DEREF_NEVER if -R was specified, else set it to DEREF_ALWAYS. Set x.xstat accordingly for -H.
2000-08-20Declare lstat.Jim Meyering
(copy_dir): Set `xstat' member to lstat so that with `-H' we don't follow symlinks found via recursive traversal. Update uses of `dereference' to compare against new enum member names.
2000-08-20(enum Dereference_symlink): Define.Jim Meyering
(struct cp_options) [dereference]: Change type to Dereference_symlink.
2000-08-20(print_totals): Rename global from opt_combined_arguments.Jim Meyering
2000-08-19fix my grammar error in last changeJim Meyering
2000-08-19(writeline): Correct comments.Jim Meyering
From Bruno Haible.
2000-08-18(DO_CHOWN): Do not make a special case for non-root.Jim Meyering
POSIX.2 requires that cp -p and mv attempt to set the uid of the destination file, even if you're not root. This affects behavior only on hosts that let you give files away via chmod.
2000-08-15(count_entry): Remember the current directory also for `.'Jim Meyering
and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
2000-08-14remove incorrect FIXME comment.Jim Meyering
2000-08-14(copy_reg): Move declaration of local, `n_read', intoJim Meyering
the scope where it's used. (copy_internal): In calling copy_reg, pass not the raw `src_mode', but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'.
2000-08-13(copy_reg): Add comment.Jim Meyering
2000-08-13(get_dest_mode): Rename from new_nondir_mode.Jim Meyering
Honor the umask for `cp', but not for `mv' or `cp -p'. (copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open. (copy_internal): Change type of locals `src_mode' and `src_type' from int to mode_t. Remove unnecessary local `fix_mode'. Combine two if-stmts into one. Pass `src_mode' as 4th arg to copy_reg. If we've just created a new regular file, return early, skipping the chmod step. copy_reg now sets permissions of such files upon creation. Use get_dest_mode, so there's just one chmod call here.
2000-08-11Add support for multi-byte locales.Jim Meyering
(iswprint, mbrtowc, wcwidth): Provide default definitions. (total_bytes): New variable. (print_bytes): New variable. (longopts): Change abbreviation for --chars from 'c' to 'm'. (usage): Update. (write_counts): Add `bytes' argument. (wc): New variables `bytes', `count_bytes', `count_chars', `count_complicated'. The old code determines `bytes', not `chars'. New case for MB_CUR_MAX > 1. A non-printable non-space character does not increment the line position or start a word. Update `total_bytes'. (main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm' option. Pass `total_bytes' to write_counts.
2000-08-11(usage): Describe -d and -i in a locale-independent way.Jim Meyering
2000-08-11(usage): Don't describe System V syntax, as it doesn't always work.Jim Meyering
2000-08-08(movefile): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(remove_cwd_entries, rm): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(main): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(do_link): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(main): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(xstrndup): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-08-08(cut_fields): Invoke xalloc_die instead of printing our own message.Jim Meyering
(cut_fields): Check for I/O error as well as end-of-file.
2000-08-08(copy_dir, copy_internal): Invoke xalloc_die instead of printing our own ↵Jim Meyering
message.