summaryrefslogtreecommitdiffstats
path: root/bin/ed/buf.c
diff options
context:
space:
mode:
authorhelbig <helbig@FreeBSD.org>1997-12-31 12:25:35 +0000
committerhelbig <helbig@FreeBSD.org>1997-12-31 12:25:35 +0000
commitab7e7a033c349ecd5a931f3e82871405b9cd9f75 (patch)
treefd9ec714bec4a0cf4aba1409f5ff1b3a1801b2bf /bin/ed/buf.c
parent6f7edd1397ed7cb0493b61cdd226b2ee871d8ce7 (diff)
downloadFreeBSD-src-ab7e7a033c349ecd5a931f3e82871405b9cd9f75.zip
FreeBSD-src-ab7e7a033c349ecd5a931f3e82871405b9cd9f75.tar.gz
Ensure stdout is line buffered.
Change "pat" -> "re" in man page.
Diffstat (limited to 'bin/ed/buf.c')
-rw-r--r--bin/ed/buf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index 7694d5f..511d83a 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -31,7 +31,7 @@
static char * const rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
#else
static char * const rcsid =
- "$Id: buf.c,v 1.13 1997/10/08 13:46:39 eivind Exp $";
+ "$Id: buf.c,v 1.14 1997/10/09 11:05:16 eivind Exp $";
#endif
#endif /* not lint */
@@ -268,6 +268,10 @@ init_buffers()
hello, world
EOF */
setbuffer(stdin, stdinbuf, 1);
+
+ /* Ensure stdout is line buffered. This avoids bogus delays
+ of output if stdout is piped through utilities to a terminal. */
+ setvbuf(stdout, NULL, _IOLBF, 0);
if (open_sbuf() < 0)
quit(2);
REQUE(&buffer_head, &buffer_head);
OpenPOWER on IntegriCloud