summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-09-18 11:31:22 +0100
committerPádraig Brady <P@draigBrady.com>2014-09-19 11:25:23 +0100
commit756a928c8c4823bd0ed541ecbbc5b4ea7a2ccaa9 (patch)
tree822857b880e991b55b831791db5180d166b7a1c3 /src/copy.c
parent90aa291c39ca8970fbce310cc317c5cc7b392691 (diff)
downloadcoreutils-756a928c8c4823bd0ed541ecbbc5b4ea7a2ccaa9.tar.xz
cp: fix handling of -H with multiply specified source dirs
Following on from commit v5.92-729-g130dd06, also avoid the erroneous directory hardlink warning with -H. * src/copy.c (copy_internal): Also handle the -H case for command line arguments. * tests/cp/duplicate-sources.sh: Augment the test case. * NEWS: Augment the news entry.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index 4e0d266b6..b7baee4b6 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2198,7 +2198,9 @@ copy_internal (char const *src_name, char const *dst_name,
There we just warn and return here. */
return true;
}
- else if (x->dereference == DEREF_ALWAYS)
+ else if (x->dereference == DEREF_ALWAYS
+ || (command_line_arg
+ && x->dereference == DEREF_COMMAND_LINE_ARGUMENTS))
{
/* This happens when e.g., encountering a directory for the
second or subsequent time via symlinks when cp is invoked