Age | Commit message (Collapse) | Author |
|
verbose, hard_dir_link, dereference_dest_dir_symlinks,
do_link, main): Use bool for booleans.
|
|
bother to check for this.
|
|
and --no-target-directory options, respectively.
(NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
Remove. All uses changed to 'T' and 't', respectively.
(long_options, main, usage): Add -t and -T as
aliases for --target-directory and --no-target-directory,
respectively.
|
|
(NO_TARGET_DIRECTORY_OPTION): New constant.
(long_options, usage, main): Add support for
|
|
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/ln.c, src/mv.c: Likewise.
* src/cp.c (do_copy): Use it.
* src/ln.c (main): Likewise.
* src/mv.c (main): Likewise.
* 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/ln.c (main): Likewise.
* src/mv.c (main): Likewise.
* src/cp.c (do_copy): Remove test for trailing slash, since
target_directory_operand now does this.
* src/ln.c (main): Likewise.
* src/mv.c (movefile): Likewise.
* 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.
* src/ln.c (main): Likewise.
* src/ln.c (isdir): Remove decl; no longer needed.
* src/mv.c (isdir, lstat): Likewise.
* src/ln.c (do_link): New arg dest_is_dir. All uses changed.
Don't check the destination ourself; rely on dest_is_dir.
This way we can avoid lstatting the destination in the
usual case, and in the worst case we lstat 1, not 3 times.
Don't bother to unlink unless link failed; this saves a syscall.
Remove unnecessary backup_succeeded flag;
it was identical to "dest_backup != NULL".
* src/ln.c (main): Use int to count to argc, not unsigned int.
This handles negative operand counts.
* src/mv.c (main): Likewise.
|
|
d/" incorrectly created a link d/x/x. It also saves some system
calls.
(main): Don't append basename to dest if this
results in an existing directory name.
|
|
(main): Avoid subscript error when the destination is "".
|
|
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.
|
|
Instead, include yesno.h.
|
|
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
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.
|
|
work even for superuser. Suggestion from Dan Jacobson.
|
|
|
|
(PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
(do_link): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
|
|
adequate, since join.c uses alloca, yet lacked an in-file #pragma.
Remove `#pragma alloca'.
|
|
(do_link): Don't warn about hard link to symlink.
|
|
|
|
|
|
|
|
Patch by Dmitry V. Levin.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
|
|
|
|
instead of hard-coding --help and --version descriptions.
|
|
for short options too.''
|
|
descriptions are alone in their own string.
|
|
Use fputs, not printf.
|
|
`and'.
|
|
Patch by Frederik Eaton.
|
|
|
|
|
|
|
|
|
|
|
|
corresponding argument in a `quote (...)' call.
Add more precise diagnostics.
|
|
are easier to translate. Reported by Michel Robitaille.
(main): Drop support for the case in which S_ISLNK wasn't defined.
It was broken in any case.
|
|
|
|
optional argument, the -b option accepts none.
(main): Use `backup type' in call to xget_version, not the
now-deprecated `--version-control'.
|
|
From Michael Stone.
|
|
`--backup --verbose' as cp, mv, install. Before this, the backup
file name wasn't printed at all.
|
|
List new --target-directory=... usage.
Reported by Göran Uddeborg
|
|
|
|
|
|
|