tmk: plan9 style. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 2738cc3cfc053a5922aee655405c0ab620beae0f
 (DIR) parent c65d179354fd3fd6f9719531f3414cf1c9c5280a
 (HTM) Author: Dan Cross <cross@gajendra.net>
       Date:   Wed,  8 Jan 2020 01:36:49 +0000
       
       mk: plan9 style.
       
       In general, no space after `if` etc, and no
       braces for a single statement inside of a loop
       or conditional.
       
       Signed-off-by: Dan Cross <cross@gajendra.net>
       
       Diffstat:
         M src/cmd/mk/archive.c                |      15 ++++++++-------
       
       1 file changed, 8 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/mk/archive.c b/src/cmd/mk/archive.c
       t@@ -122,11 +122,11 @@ static int
        allspaces(char *a, int n)
        {
                int i;
       -        for (i = 0; i < n; i++) {
       -                if (a[i] != ' ') {
       +
       +        for(i=0; i<n; i++)
       +                if(a[i] != ' ')
                                return 0;
       -                }
       -        }
       +
                return 1;
        }
        
       t@@ -166,10 +166,11 @@ atimes(char *ar)
                        }else if(memcmp(h.name, "// ", 3) == 0){ /* GNU */
                                /* date, uid, gid, mode all ' ' */
                                if(!allspaces(&h.name[3], sizeof(h.name) - 3) ||
       -                           !allspaces(h.date, sizeof(h.date)) || !allspaces(h.uid, sizeof(h.uid)) ||
       -                           !allspaces(h.gid, sizeof(h.gid)) || !allspaces(h.mode, sizeof(h.mode))){
       +                           !allspaces(h.date, sizeof(h.date)) ||
       +                           !allspaces(h.uid, sizeof(h.uid)) ||
       +                           !allspaces(h.gid, sizeof(h.gid)) ||
       +                           !allspaces(h.mode, sizeof(h.mode)))
                                        goto skip;
       -                        }
                                t = atol(h.size);
                                if(t&01)
                                        t++;