summaryrefslogtreecommitdiff
path: root/tests/mv/diag
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-06-28 18:39:28 +0000
committerJim Meyering <jim@meyering.net>2004-06-28 18:39:28 +0000
commit6860c032dac6a807a908125edd1dc2f95549ca5a (patch)
tree9951953e1d5b34f15b21ff517a1992785b76fe6e /tests/mv/diag
parent59c3b539268fd48dd5fd9d63eacfd19534cc4146 (diff)
downloadcoreutils-6860c032dac6a807a908125edd1dc2f95549ca5a.tar.xz
Use more-consistent rules among cp, ln, and mv when dealing with
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/ln.c (isdir): Remove decl; no longer needed. * src/mv.c (isdir, lstat): Likewise. * src/ln.c (main): Use int to count to argc, not unsigned int. This handles negative operand counts. * src/mv.c (main): Likewise. * src/mv.c (do_move): Don't call hash_init; expect the caller to do it, for consistency with cp.c and ln.c. All callers changed. (movefile): dest_is_dir parameter is now bool, not int. (main): Standardize on "missing destination file operand after %s" for the diagnostic, for consistency with cp.c.
Diffstat (limited to 'tests/mv/diag')
0 files changed, 0 insertions, 0 deletions