]> git.pld-linux.org Git - packages/bsd-finger.git/blame - bsd-finger-pts.patch
- fixes some rfc 742 feactures (patch from rawhide).
[packages/bsd-finger.git] / bsd-finger-pts.patch
CommitLineData
f04370fa
JR
1--- bsd-finger-0.10/finger/util.c.pts Thu Apr 8 13:49:11 1999
2+++ bsd-finger-0.10/finger/util.c Thu Apr 8 13:51:49 1999
3@@ -68,9 +68,15 @@
4 return;
5 snprintf(tbuf, TBUFLEN, "%s/%s", _PATH_DEV, w->tty);
6 if (stat(tbuf, &sb) < 0) {
7+ switch(errno) {
8+ case ENOENT:
9+ break;
10+ default:
11 (void)fprintf(stderr,
12 "finger: %s: %s\n", tbuf, strerror(errno));
13- return;
14+ break;
15+ }
16+ return;
17 }
18 w->idletime = now < sb.st_atime ? 0 : now - sb.st_atime;
19
20--- bsd-finger-0.10/finger/sprint.c.pts Thu Apr 8 14:20:51 1999
21+++ bsd-finger-0.10/finger/sprint.c Thu Apr 8 14:38:32 1999
22@@ -90,7 +90,7 @@
23 if (maxlname + maxrname < space-2) { maxlname++; maxrname++; }
24
25 (void)printf("%-*s %-*s %s\n", maxlname, "Login", maxrname,
26- "Name", "Tty Idle Login Time Office Office Phone");
27+ "Name", " Tty Idle Login Time Office Office Phone");
28 for (cnt = 0; cnt < entries; ++cnt) {
29 pn = list[cnt];
30 for (w = pn->whead; w != NULL; w = w->next) {
31@@ -103,12 +103,14 @@
32 }
33 (void)putchar(w->info == LOGGEDIN && !w->writable ?
34 '*' : ' ');
35- if (*w->tty)
36- (void)printf("%-2.2s ",
37- w->tty[0] != 't' || w->tty[1] != 't' ||
38- w->tty[2] != 'y' ? w->tty : w->tty + 3);
39- else
40- (void)printf(" ");
41+ if (*w->tty) {
42+ char *t = w->tty;
43+ if ((t[0] == 't' && t[1] == 't' && t[2] == 'y')
44+ || (t[0] == 'p' && t[1] == 't' && t[2] == 's'))
45+ t += 3;
46+ (void)printf("%-4.4s ", t);
47+ } else
48+ (void)printf(" ");
49 if (w->info == LOGGEDIN) {
50 stimeprint(w);
51 (void)printf(" ");
This page took 0.06878 seconds and 4 git commands to generate.