From: Jim Meyering Date: Fri, 30 Apr 1999 15:40:34 +0000 (+0000) Subject: (copy_internal): Move the one-file-system test so that X-Git-Tag: SH-UTILS-1_16h~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25a8d1f1e98ef60c9a8b7f6a46bc96b12246c59a;p=thirdparty%2Fcoreutils.git (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. --- 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,