aboutsummaryrefslogtreecommitdiff
path: root/libbb/copy_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/copy_file.c')
-rw-r--r--libbb/copy_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 9c1bba689..d3902ffbe 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -40,9 +40,9 @@ int copy_file(const char *source, const char *dest, int flags)
40 int dest_exists = 1; 40 int dest_exists = 1;
41 int status = 0; 41 int status = 0;
42 42
43 if (((flags & FILEUTILS_PRESERVE_SYMLINKS) && 43 if ((!(flags & FILEUTILS_DEREFERENCE) &&
44 lstat(source, &source_stat) < 0) || 44 lstat(source, &source_stat) < 0) ||
45 (!(flags & FILEUTILS_PRESERVE_SYMLINKS) && 45 ((flags & FILEUTILS_DEREFERENCE) &&
46 stat(source, &source_stat) < 0)) { 46 stat(source, &source_stat) < 0)) {
47 perror_msg("%s", source); 47 perror_msg("%s", source);
48 return -1; 48 return -1;