On Mon, Mar 21, 2011 at 12:04:33PM +0100, Benny Lofgren wrote:
> 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

No personal comment on the diff, but a nitpick:

No C++ style comments please.

/* */ style only (see style(9) for more details).

>               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
>

Cheers,

-0-
--
Man 1:  Ask me the what the most important thing about telling a good
        joke is.

Man 2:  OK, what is the most impo --

Man 1:  ______TIMING!

Reply via email to