From aa2ff6632654637f3f4611a4a86076f8d28c1d35 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 18 Jun 2008 22:04:15 +0000 Subject: [PATCH] The attribute copy operation was nested inside a conditional block which wouldn't be executed if the file being copied was zero bytes in length. Moved outside the block to where permissions and other optional operations are handled. This fixes bug #2259. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26013 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/coreutils/src/copy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/coreutils/src/copy.c b/src/bin/coreutils/src/copy.c index 31cae063f2..67f6043dc0 100644 --- a/src/bin/coreutils/src/copy.c +++ b/src/bin/coreutils/src/copy.c @@ -440,10 +440,6 @@ copy_reg (char const *src_name, char const *dst_name, #endif } - if (x->ignore_attributes == 0 - && copy_attributes(source_desc, dest_desc) != 0) - fprintf(stderr, "%s: could not copy attributes\n", src_name); - /* If not making a sparse file, try to use a more-efficient buffer size. */ if (! make_holes) @@ -644,6 +640,11 @@ copy_reg (char const *src_name, char const *dst_name, } } + if (x->ignore_attributes == 0 + && copy_attributes(source_desc, dest_desc) != 0) + fprintf(stderr, "%s: could not copy attributes\n", src_name); + + close_src_and_dst_desc: if (close (dest_desc) < 0) {