Date: Sat, 12 Aug 1995 10:42:33 +0000 From: "Mike O'Brien" <obrien@leonardo.net> To: hackers@freebsd.org Subject: minor frob for 'finger' Message-ID: <199508121042.KAA00405@mr-p.protocorp.com>
next in thread | raw e-mail | index | archive | help
Longtime ARPAnauts will remember that 'finger' used to work a little differently over the net - the closing brace around the host name was not printed until a net connection had been successfully established. That code broke in the UNIX version when stdout to a terminal was made line-buffered by default...and now I see the original code (which must have looked very mysterious) has disappeared entirely, in favor of having the host name printed before the connection rather than after, which was the effect of the breakage. I'm sorry, but I'm an old fart. I prefer finger's original behavior. Hence, this patch, humbly proffered: *** net.c.dist Tue May 30 06:30:16 1995 --- net.c Sat Aug 12 10:32:20 1995 *************** *** 95,106 **** } /* have network connection; identify the host connected with */ ! (void)printf("[%s]\n", hp->h_name); if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("finger: connect"); (void)close(s); return; } /* -l flag for remote fingerd */ if (lflag) --- 95,108 ---- } /* have network connection; identify the host connected with */ ! (void)printf("[%s", hp->h_name); ! (void)fflush(stdout); if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { perror("finger: connect"); (void)close(s); return; } + (void)printf("]\n"); /* -l flag for remote fingerd */ if (lflag)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508121042.KAA00405>