summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-04-30 15:40:34 +0000
committerJim Meyering <jim@meyering.net>1999-04-30 15:40:34 +0000
commit25a8d1f1e98ef60c9a8b7f6a46bc96b12246c59a (patch)
treeff168c34d64080a5245213cc6f763b42f42f1bf3 /src/copy.c
parentf0e50d53d5f6ed1ddcca95b903257b3a64adf982 (diff)
downloadcoreutils-25a8d1f1e98ef60c9a8b7f6a46bc96b12246c59a.tar.xz
(copy_internal): Move the one-file-system test so that
it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block. Prior to this change, `cp --one-file-system' would traverse a file- system boundary if the destination directory existed. From thospel@mail.dma.be.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index 726ed8bd3..fe68d49f4 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -696,12 +696,12 @@ copy_internal (const char *src_path, const char *dst_path,
if (x->verbose)
printf ("%s -> %s\n", src_path, dst_path);
-
- /* Are we crossing a file system boundary? */
- if (x->one_file_system && device != 0 && device != src_sb.st_dev)
- return 0;
}
+ /* Are we crossing a file system boundary? */
+ if (x->one_file_system && device != 0 && device != src_sb.st_dev)
+ return 0;
+
/* Copy the contents of the directory. */
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x,