summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/copy.c8
-rwxr-xr-xtests/cp/existing-perm-dir2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/copy.c b/src/copy.c
index b2aeb6ece..aaf7e79aa 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -951,7 +951,9 @@ copy_reg (char const *src_name, char const *dst_name,
dest_errno = ENOTDIR;
}
else
- omitted_permissions = 0;
+ {
+ omitted_permissions = 0;
+ }
if (dest_desc < 0)
{
@@ -2212,7 +2214,9 @@ copy_internal (char const *src_name, char const *dst_name,
emit_verbose (src_name, dst_name, NULL);
}
else
- omitted_permissions = 0;
+ {
+ omitted_permissions = 0;
+ }
/* Decide whether to copy the contents of the directory. */
if (x->one_file_system && device != 0 && device != src_sb.st_dev)
diff --git a/tests/cp/existing-perm-dir b/tests/cp/existing-perm-dir
index 6ef73f0a0..a8c281669 100755
--- a/tests/cp/existing-perm-dir
+++ b/tests/cp/existing-perm-dir
@@ -25,7 +25,7 @@ mkdir -p -m ug-s,u=rwx,g=,o= dst/dir || fail=1
cp -r src/. dst/ || fail=1
-mode=`ls -ld dst/dir | cut -b-10`
+mode=$(stat --p=%A dst/dir)
test "$mode" = drwx------ || fail=1
Exit $fail