summaryrefslogtreecommitdiff
path: root/src/cp.c
AgeCommit message (Collapse)Author
2004-06-28 Use more-consistent rules among cp, ln, and mv when dealing withJim Meyering
last operands that are (or look like) directories. * src/cp.c (target_directory_operand): New, nearly-common function, It reports an error if the destination appears to be a directory (e.g., because it has a trailing slash) but is not. * src/cp.c (do_copy): Use it. * src/cp.c (do_copy): Don't assume argc is positive. Don't bother to lstat dest, since copy() will do that for us. Use "const" to avoid the need for cast. * src/cp.c (do_copy): Don't output a usage message because of file problems (e.g., an operand is not a directory). Use it only for syntax. Standardize on "target %s is not a directory" for the diagnostic. * src/cp.c (do_copy): Remove test for trailing slash, since target_directory_operand now does this. * src/cp.c (main): Reject multiple target directories. Check whether a specified target is a directory when parsing the options, using stat. This gives more-accurate diagnostics.
2004-06-28(usage): Fix copy+paste error in description ofJim Meyering
--target-directory: s/move/copy/. From Paul Jarc.
2004-06-21Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included. (do_copy): Likewise.
2004-03-13(do_copy): Tweak wording in a diagnostic.Jim Meyering
Suggestion from Karl Berry. Include "quoatearg.h". (do_copy): Use quotearg_colon (not quote) for diagnostics that begin with `"%s:'.
2004-02-07(re_protect): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.Jim Meyering
(do_copy): Declare/use local xstat rather than x->xstat. (main): Remove code that set x.xstat.
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(exit_status): Remove static var.... (main): Making it local here instead. Use =, not |=, to set it.
2004-01-04(re_protect): Use ASSIGN_STRDUPA rather than alloca and strcpy.Jim Meyering
(make_path_private): Likewise.
2003-11-02(make_path_private): Use `sizeof *var' rather than `sizeof EXPLICIT_TYPE'.Jim Meyering
The former is more maintainable and usually shorter.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-08-09Include utimens.h.Jim Meyering
(re_protect): Set file timestamps with utimens, not utime.
2003-07-12It appears that the `#pragma alloca' included via "system.h" isJim Meyering
adequate, since join.c uses alloca, yet lacked an in-file #pragma. Remove `#pragma alloca'.
2003-07-04(do_copy): Give a better diagnostic when failing dueJim Meyering
to nonexistent destination directory. Reported by Dmitry Rutsky. See http://bugs.debian.org/199730 for details.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-04-11Remove SPC in SPC-TAB sequence.Jim Meyering
2003-04-11Remove anachronistic casts of xmalloc,Jim Meyering
xrealloc, and xcalloc return values and of xrealloc's first argument.
2003-03-09fix typo in commentJim Meyering
2003-03-07Remove everything associated with mmap-stack.c.Jim Meyering
This reverts the two changes of 2003-02-21.
2003-02-21Include "mmap-stack.h".Jim Meyering
(main): Invoke `run' through a macro that (when possible) runs it with a large, mmap'd stack.
2003-02-17(run): New function, preparing for use ofJim Meyering
RUN_WITH_BIG_STACK_*
2003-01-03(do_copy): Tweak diagnostic to be consistent with the oneJim Meyering
from mv: s/missing file arguments/missing file argument/. With --target-directory=DIR, cp and mv work with a single file argument. Reported by Karl Berry.
2002-12-11Fix a bug whereby cp would fail to parse an option likeJim Meyering
--preserve=mode,ownership. (decode_preserve_arg): Advance `comma' to point the character following the comma.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-06-21Change all `preserving ...' diagnostics toJim Meyering
`failed to preserve ...' to make the failure clearer.
2002-03-10(do_copy): Change wording in diagnostic.Jim Meyering
2002-03-03(COPY_CONTENTS_OPTION): New enum value.Jim Meyering
(long_opts): Add --copy-contents. (usage): Describe new behavior. Sort options. (main): Implement new behavior. Remove diagnostics for -a and -r; no longer needed.
2002-03-02(main): Warn when -r is specified before --archive (-a).Jim Meyering
2002-03-02(main): Revert change of 2001-12-29. With this change,Jim Meyering
cp -r once again preserves symlinks. (usage): Document the original (now-restored) behavior.
2002-03-02(main): Fail if -r is specified after --archive (-a) on the command line.Jim Meyering
2001-12-29(main): With -r, always dereference symlinks.Jim Meyering
2001-12-11(re_protect):Jim Meyering
Include the word `fail' in some diagnostics to make it clearer that they indicate a failure. s/getting attributes/failed to get attributes/
2001-12-02Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23(usage): Note that ``Mandatory arguments to long options are mandatoryJim Meyering
for short options too.''
2001-11-23Split usage strings so that --help and --versionJim Meyering
descriptions are alone in their own string.
2001-11-23(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-11-22(cp_option_init): Likewise.Jim Meyering
(do_copy): Call src_info_init.
2001-11-22(cp_option_init): Initialize new member.Jim Meyering
(do_copy): Remove const attribute from declaration of parameter, x. dest_info_init now takes a parameter.
2001-10-24(main): Free hash table storage.Jim Meyering
2001-10-14Now, -P is the same as --no-dereference, per POSIX.Jim Meyering
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.
2001-10-13(enum) [NO_DEREFERENCE_OPTION]: New member.Jim Meyering
(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.
2001-10-13(cp_option_init): Don't set it.Jim Meyering
2001-10-13* src/copy.h (struct cp_options): Rename members:Jim Meyering
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.
2001-10-07(do_copy): Don't clear the hash table after processingJim Meyering
each command line argument.
2001-10-06(main): Reflect that hash_init now takes no arguments.Jim Meyering
2001-09-28(do_copy): Call dest_info_init if necessary.Jim Meyering