diff options
author | pst <pst@FreeBSD.org> | 1994-09-07 07:22:41 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1994-09-07 07:22:41 +0000 |
commit | 72c244e5533a91ef34a3fac2404611a46ee6874a (patch) | |
tree | ef10cc8b732e94b450f8199f8c72cfd130652b5a /usr.bin/finger/lprint.c | |
parent | 62391009757751f11deb63fb9ed07fab5976c86c (diff) | |
download | FreeBSD-src-72c244e5533a91ef34a3fac2404611a46ee6874a.zip FreeBSD-src-72c244e5533a91ef34a3fac2404611a46ee6874a.tar.gz |
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
Diffstat (limited to 'usr.bin/finger/lprint.c')
-rw-r--r-- | usr.bin/finger/lprint.c | 21 |
1 files changed, 20 insertions, 1 deletions
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 |