From owner-freebsd-current@FreeBSD.ORG Thu Apr 24 12:54:16 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB35137B401 for ; Thu, 24 Apr 2003 12:54:16 -0700 (PDT) Received: from hotmail.com (bay7-f110.bay7.hotmail.com [64.4.11.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8163543F75 for ; Thu, 24 Apr 2003 12:54:16 -0700 (PDT) (envelope-from howcanthisbe300@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 24 Apr 2003 12:54:16 -0700 Received: from 217.229.72.168 by by7fd.bay7.hotmail.msn.com with HTTP; Thu, 24 Apr 2003 19:54:16 GMT X-Originating-IP: [217.229.72.168] X-Originating-Email: [howcanthisbe300@hotmail.com] From: "How Can ThisBe" To: freebsd-current@freebsd.org Date: Thu, 24 Apr 2003 19:54:16 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 24 Apr 2003 19:54:16.0480 (UTC) FILETIME=[49702200:01C30A9B] Subject: suggested change to 'write' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2003 19:54:17 -0000 A friend and I have been using 'write' to communticate to each other, its very handy but has a small annoyance (to us anyway) where you can lose track for the thread when you look back over it. Anyway, below is a tiny patch that helps to see who wrote what. We have found it very helpful. *** write.c.orig Thu Apr 24 21:29:02 2003 --- write.c Thu Apr 24 21:40:08 2003 *************** *** 280,287 **** (void)printf("\r\n\007\007\007Message from %s@%s on %s at %s ...\r\n", login, host, mytty, nows + 11); ! while (fgets(line, sizeof(line), stdin) != NULL) wr_fputs(line); } /* --- 280,289 ---- (void)printf("\r\n\007\007\007Message from %s@%s on %s at %s ...\r\n", login, host, mytty, nows + 11); ! while (fgets(line, sizeof(line), stdin) != NULL){ ! (void)printf("\n%s: ",login); wr_fputs(line); + } } /* _________________________________________________________________