From 72c244e5533a91ef34a3fac2404611a46ee6874a Mon Sep 17 00:00:00 2001 From: pst Date: Wed, 7 Sep 1994 07:22:41 +0000 Subject: Install Luke's enhancements for finger. By default, behave like the old ugly 4.4bsd finger and print office information instead of remote login information. It's an easy one line fix to make it behave like most other vendor's fingers if we decide to change the default. Reviewed by: pst --- usr.bin/finger/lprint.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'usr.bin/finger/lprint.c') diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index d079c24..51e0f96 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -113,6 +113,7 @@ lprint(pn) * home directory * shell * office, office phone, home phone if available + * mail status */ (void)printf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s", pn->name, pn->realname, pn->dir); @@ -152,7 +153,8 @@ lprint(pn) putchar('\n'); /* - * long format con't: * if logged in + * long format con't: + * if logged in * terminal * idle time * if messages allowed @@ -221,6 +223,23 @@ lprint(pn) } putchar('\n'); } + if (pn->mailrecv == -1) + printf("No Mail.\n"); + else if (pn->mailrecv > pn->mailread) { + tp = localtime(&pn->mailrecv); + t = asctime(tp); + tzn = tp->tm_zone; + printf("New mail received %.16s %.4s (%s)\n", t, t + 20, tzn); + tp = localtime(&pn->mailread); + t = asctime(tp); + tzn = tp->tm_zone; + printf(" Unread since %.16s %.4s (%s)\n", t, t + 20, tzn); + } else { + tp = localtime(&pn->mailread); + t = asctime(tp); + tzn = tp->tm_zone; + printf("Mail last read %.16s %.4s (%s)\n", t, t + 20, tzn); + } } static int -- cgit v1.1