summaryrefslogtreecommitdiff
path: root/coreutils/cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cp.c')
-rw-r--r--coreutils/cp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index ee40af50b..961de5b42 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -215,7 +215,8 @@ int cp_main(int argc, char **argv)
(flags & FILEUTILS_DEREFERENCE) ? stat : lstat);
if (s_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;
- d_flags = cp_mv_stat(last, &dest_stat);
+ d_flags = cp_mv_stat2(last, &dest_stat,
+ (flags & FILEUTILS_NO_TARGET_DIR) ? lstat : stat);
if (d_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;