svn commit: r221727 - head/usr.bin/tip/tip
Poul-Henning Kamp
phk at FreeBSD.org
Tue May 10 10:58:58 UTC 2011
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);
}
}
}
More information about the svn-src-all
mailing list