mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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.
This commit is contained in:
parent
4b89ae574c
commit
9fc9ddee09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221727
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue