summaryrefslogtreecommitdiff
path: root/src/ln.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-06-28 18:35:54 +0000
committerJim Meyering <jim@meyering.net>2004-06-28 18:35:54 +0000
commit8340545c8b2034b19c4ac681725922cd9c14cfbd (patch)
treea529e336b782cb06105b96b11802a17a034e8360 /src/ln.c
parent86e30699e40d0dc74b5a5035323b3f0a9c1d4f73 (diff)
downloadcoreutils-8340545c8b2034b19c4ac681725922cd9c14cfbd.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/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.
Diffstat (limited to 'src/ln.c')
0 files changed, 0 insertions, 0 deletions