From owner-svn-src-head@FreeBSD.ORG Tue May 10 10:58:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36475106566C; Tue, 10 May 2011 10:58:58 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 271128FC16; Tue, 10 May 2011 10:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AAwwB3041209; Tue, 10 May 2011 10:58:58 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AAwwkv041206; Tue, 10 May 2011 10:58:58 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105101058.p4AAwwkv041206@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 10 May 2011 10:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221727 - head/usr.bin/tip/tip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 10:58:58 -0000 Author: phk Date: Tue May 10 10:58:57 2011 New Revision: 221727 URL: http://svn.freebsd.org/changeset/base/221727 Log: Flush the scriptfile whenever we see a non-graphical character to get more real-time logging, without forcing a write(2) on every single character. Modified: head/usr.bin/tip/tip/tipout.c Modified: head/usr.bin/tip/tip/tipout.c ============================================================================== --- head/usr.bin/tip/tip/tipout.c Tue May 10 10:48:43 2011 (r221726) +++ head/usr.bin/tip/tip/tipout.c Tue May 10 10:58:57 2011 (r221727) @@ -170,12 +170,18 @@ tipout(void) if (boolean(value(SCRIPT)) && fscript != NULL) { if (!boolean(value(BEAUTIFY))) { fwrite(buf, 1, cnt, fscript); - continue; + } else { + for (cp = buf; cp < buf + cnt; cp++) + if ((*cp >= ' ' && *cp <= '~') || + any(*cp, value(EXCEPTIONS))) + putc(*cp, fscript); + } + for (cp = buf; cp < buf + cnt; cp++) { + if (!isgraph(*cp)) { + fflush(fscript); + break; + } } - for (cp = buf; cp < buf + cnt; cp++) - if ((*cp >= ' ' && *cp <= '~') || - any(*cp, value(EXCEPTIONS))) - putc(*cp, fscript); } } }