diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-09-18 11:31:22 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-09-19 11:25:23 +0100 |
commit | 756a928c8c4823bd0ed541ecbbc5b4ea7a2ccaa9 (patch) | |
tree | 822857b880e991b55b831791db5180d166b7a1c3 /src | |
parent | 90aa291c39ca8970fbce310cc317c5cc7b392691 (diff) | |
download | coreutils-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')
-rw-r--r-- | src/copy.c | 4 |
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 |