summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-10-17 21:27:11 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-10-17 21:27:11 +0000
commit6cd47be411c589908d898d11f56abe850fe83cab (patch)
tree6035c5ee7ae5c87c1e7348519b2920d5dd5c3af9
parent50932e83ff8ea988471f12c07fc593bb9814af8c (diff)
Correctly encode half line feed in the output stream for -f;
this patch only changes two bits, note that '\011' != '9' == '\071'. Bug introduced by the original author, Michael Rendell, and committed by Keith Bostic on May 22, 1990 (CSRG SCCS rev. 5.1). The following operating systems are affected: 4.3BSD Reno, BSD Net/2, 4.4BSD, 4.4BSD Lite1, 4.4BSD Lite2, and all versions of 386BSD, NetBSD, OpenBSD, FreeBSD, DragonFly, Debian GNU/Linux (package bsdmainutils) and probably many others. "that's a fun one" millert@, "nice find" deraadt@
-rw-r--r--usr.bin/col/col.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index 26410064d5f..42f4c61f97c 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: col.c,v 1.13 2014/10/16 13:45:12 schwarze Exp $ */
+/* $OpenBSD: col.c,v 1.14 2014/10/17 21:27:10 schwarze Exp $ */
/* $NetBSD: col.c,v 1.7 1995/09/02 05:48:50 jtc Exp $ */
/*-
@@ -350,7 +350,7 @@ flush_blanks(void)
PUTC('\n');
if (half) {
PUTC('\033');
- PUTC('9');
+ PUTC('\011');
if (!nb)
PUTC('\r');
}