]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: use consistent style in C and test scripts
authorJim Meyering <meyering@redhat.com>
Tue, 26 Jul 2011 07:01:44 +0000 (09:01 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 26 Jul 2011 07:01:44 +0000 (09:01 +0200)
* src/copy.c (copy_internal): Adjust formatting style to conform with
guidelines in HACKING: put braces around two one-line "else" blocks.
* tests/cp/existing-perm-dir: Use $(...), not `...`, and
stat rather than ls+cut to get the mode string.
mode=$(stat --p=%A dst/dir)

src/copy.c
tests/cp/existing-perm-dir

index b2aeb6ece9ce34bb3651c55e72b62f124ce73ad4..aaf7e79aa59c335d7b9949c889c95f98a2ec6610 100644 (file)
@@ -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)
index 6ef73f0a0373918fac1a4a86f60c763c744f7b1b..a8c281669924b061371da84a7636098521d38ec9 100755 (executable)
@@ -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