Printing just the file name (as opposed to the full path) is 
how NetBSD and linux behave. FreeBSD has the same behaviour as
OpenBSD. I'd follow the first 2. Any objections?

-lum

>Might I suggest using basename()?
>
>--- last.c.orig 2009-10-27 23:59:39.000000000 +0000
>+++ last.c      2013-02-09 01:43:04.709416732 +0000
>@@ -36,6 +36,7 @@
> #include <ctype.h>
> #include <err.h>
> #include <fcntl.h>
>+#include <libgen.h>
> #include <paths.h>
> #include <signal.h>
> #include <stdio.h>
>@@ -407,7 +408,7 @@
>                            asctime(gmtime(&total))+11);
>        }
>        ct = ctime(&buf[0].ut_time);
>-       printf("\nwtmp begins %10.10s %*.*s %4.4s\n", ct, timesize, timesize,
>+       printf("\n%s begins %10.10s %*.*s %4.4s\n", basename(file),
>ct, timesize, timesize,
>            ct + 11, ct + 20);
> }

Reply via email to