Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!luth!sunic!tut!santra!hemuli.atk.vtt.fi!tml From: tml@hemuli.atk.vtt.fi (Tor Lillqvist) Newsgroups: comp.sys.hp Subject: Re: FINGER HP800's (?) Message-ID: <4330@hemuli.atk.vtt.fi> Date: 4 Dec 89 12:57:35 GMT References: <47500018@uxe.cso.uiuc.edu> Reply-To: tml@hemuli.atk.vtt.fi (Tor Lillqvist) Distribution: comp Organization: Technical Research Centre of Finland Lines: 53 In article kim@kannel.lut.fi (Kimmo Suominen) writes: >it does show your last login CORRECTLY. The one in hemuli shows actually your >"first login". Oops, I never noticed that... Thanks. Here is a patch to your version that fixes the followig feature: If you say "finger matti" and you have several users with real first name Matti, you will see only one of them. Now it compares the login name when deciding which session to show for a user. *** finger.c Mon Dec 4 14:54:01 1989 --- newfnger.c Mon Dec 4 14:51:02 1989 *************** *** 442,457 **** quickprint(p); continue; } if (!unshort) { shortprint(p); continue; } - #define min(a,b) ((a) < (b) ? (a) : (b)) - for (q = person1, minidle = (((unsigned)~0)>>1); q != 0; q = q->link) - if (!strcmp(q->name, p->name)) - minidle = min(minidle, q->idletime); - if (p->idletime > minidle) - continue; personprint(p); if (p->pwd != 0) { if (hack) { --- 442,461 ---- quickprint(p); continue; } + #define min(a,b) ((a) < (b) ? (a) : (b)) + if (p->pwd) { + for (q = person1, minidle = (((unsigned)~0)>>1); + q != 0; q = q->link) + if (q->pwd != 0 + && !strcmp(q->pwd->pw_name, p->pwd->pw_name)) + minidle = min(minidle, q->idletime); + if (p->idletime > minidle) + continue; + } if (!unshort) { shortprint(p); continue; } personprint(p); if (p->pwd != 0) { if (hack) { -- Tor Lillqvist, VTT/ATK