=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/last/last.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/last/last.c 2000/12/12 09:16:03 1.12 --- src/usr.bin/last/last.c 2001/01/31 17:42:26 1.13 *************** *** 1,4 **** ! /* $OpenBSD: last.c,v 1.12 2000/12/12 09:16:03 deraadt Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: last.c,v 1.13 2001/01/31 17:42:26 deraadt Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94"; #endif ! static char rcsid[] = "$OpenBSD: last.c,v 1.12 2000/12/12 09:16:03 deraadt Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94"; #endif ! static char rcsid[] = "$OpenBSD: last.c,v 1.13 2001/01/31 17:42:26 deraadt Exp $"; #endif /* not lint */ #include *************** *** 106,111 **** --- 106,114 ---- void wtmp __P((void)); void checkargs __P((void)); + #define NAME_WIDTH 8 + #define HOST_WIDTH 32 + int main(argc, argv) int argc; *************** *** 286,303 **** if (want(bp, NO)) { if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld \n", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s \n", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } --- 289,306 ---- if (want(bp, NO)) { if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld \n", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s \n", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } *************** *** 315,330 **** if (want(bp, NO)) { if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld \n", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s \n", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } if (maxrec && !--maxrec) --- 318,333 ---- if (want(bp, NO)) { if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld \n", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s \n", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } if (maxrec && !--maxrec) *************** *** 354,369 **** snapfound = 1; if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld ", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s ", ! UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } if (!T->logout) --- 357,372 ---- snapfound = 1; if (seconds) { printf("%-*.*s %-*.*s %-*.*s %ld ", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, bp->ut_time); } else { ct = ctime(&bp->ut_time); printf("%-*.*s %-*.*s %-*.*s %10.10s %*.*s ", ! NAME_WIDTH, UT_NAMESIZE, bp->ut_name, UT_LINESIZE, UT_LINESIZE, bp->ut_line, ! HOST_WIDTH, UT_HOSTSIZE, bp->ut_host, ct, timesize, timesize, ct + 11); } if (!T->logout)