Realized I was sloppy with KNF. This diff is hopefully neater looking.

Regards,
/Benny

----8<--------8<--------8<--------8<--------8<--------8<---- (cut)
Index: print.c
===================================================================
RCS file: /cvs/src/bin/ls/print.c,v
retrieving revision 1.27
diff -u -r1.27 print.c
--- print.c     12 Sep 2010 20:16:29 -0000      1.27
+++ print.c     21 Mar 2011 10:57:38 -0000
@@ -235,6 +235,7 @@
 {
        int i;
        char *longstring;
+       time_t now = time(NULL);

        longstring = ctime(&ftime);
        for (i = 4; i < 11; ++i)
@@ -244,7 +245,7 @@
        if (f_sectime)
                for (i = 11; i < 24; i++)
                        (void)putchar(longstring[i]);
-       else if (ftime + SIXMONTHS > time(NULL))
+       else if (ftime > now - SIXMONTHS && ftime < now + 5) // some grace secs
                for (i = 11; i < 16; ++i)
                        (void)putchar(longstring[i]);
        else {
----8<--------8<--------8<--------8<--------8<--------8<---- (cut)


-- 
internetlabbet.se     / work:   +46 8 551 124 80      / "Words must
Benny Lofgren        /  mobile: +46 70 718 11 90     /   be weighed,
                    /   fax:    +46 8 551 124 89    /    not counted."
                   /    email:  benny -at- internetlabbet.se

Reply via email to