summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tip/tip/tipout.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/tip/tip/tipout.c b/usr.bin/tip/tip/tipout.c
index 42fc4a2..3dff3bd 100644
--- a/usr.bin/tip/tip/tipout.c
+++ b/usr.bin/tip/tip/tipout.c
@@ -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);
}
}
}
OpenPOWER on IntegriCloud