From 25a8d1f1e98ef60c9a8b7f6a46bc96b12246c59a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 30 Apr 1999 15:40:34 +0000 Subject: [PATCH] (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. --- src/copy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/copy.c b/src/copy.c index 726ed8bd3b..fe68d49f48 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, -- 2.47.3