Deleted Added
full compact
42c42
< "$FreeBSD: head/usr.bin/finger/sprint.c 72109 2001-02-06 20:13:48Z charnier $";
---
> "$FreeBSD: head/usr.bin/finger/sprint.c 74586 2001-03-21 18:43:49Z ache $";
46a47
> #include <langinfo.h>
66a68
> struct tm *lc;
67a70,71
> if (d_first < 0)
> d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
87,88c91,92
< "Name", " TTY Idle Login Time",
< oflag ? " Office Phone" : " Where");
---
> "Name", " TTY Idle Login Time",
> oflag ? "Office Phone" : "Where");
124c128
< strftime(p, sizeof(p), "%c", localtime(&w->loginat));
---
> lc = localtime(&w->loginat);
128,135c132,144
< if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1))
< (void)printf("%.3s ", p);
< else
< (void)printf("%.6s", p + 4);
< if (now - w->loginat >= SECSPERDAY * DAYSPERNYEAR / 2)
< (void)printf(" %.4s", p + 20);
< else
< (void)printf(" %.5s", p + 11);
---
> if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1)) {
> (void)strftime(p, sizeof(p), "%a", lc);
> } else {
> (void)strftime(p, sizeof(p),
> d_first ? "%e %b" : "%b %e", lc);
> }
> (void)printf("%-6.6s", p);
> if (now - w->loginat >= SECSPERDAY * DAYSPERNYEAR / 2) {
> (void)strftime(p, sizeof(p), "%Y", lc);
> } else {
> (void)strftime(p, sizeof(p), "%R", lc);
> }
> (void)printf(" %-5.5s", p);