svn commit: r282305 - head/usr.bin/col

Baptiste Daroussin bapt at FreeBSD.org
Fri May 1 17:18:08 UTC 2015


Author: bapt
Date: Fri May  1 17:18:07 2015
New Revision: 282305
URL: https://svnweb.freebsd.org/changeset/base/282305

Log:
  col: fixing 25 year old bug
  
  Makes col(1) respect POSIX again for escape sequences as decribed in its manpage
  The bug was introduced in CSRG in 1990
  This also reverts r280911
  
  Differential Revision:	https://reviews.freebsd.org/D2424
  Reviewed by:	jhb
  MFC after:	2 weeks

Modified:
  head/usr.bin/col/col.c

Modified: head/usr.bin/col/col.c
==============================================================================
--- head/usr.bin/col/col.c	Fri May  1 16:41:46 2015	(r282304)
+++ head/usr.bin/col/col.c	Fri May  1 17:18:07 2015	(r282305)
@@ -63,9 +63,9 @@ __FBSDID("$FreeBSD$");
 #define	SI	'\017'		/* shift in to normal character set */
 #define	SO	'\016'		/* shift out to alternate character set */
 #define	VT	'\013'		/* vertical tab (aka reverse line feed) */
-#define	RLF	'\007'		/* ESC-07 reverse line feed */
-#define	RHLF	'\010'		/* ESC-010 reverse half-line feed */
-#define	FHLF	'\011'		/* ESC-011 forward half-line feed */
+#define	RLF	'7'		/* ESC-7 reverse line feed */
+#define	RHLF	'8'		/* ESC-8 reverse half-line feed */
+#define	FHLF	'9'		/* ESC-9 forward half-line feed */
 
 /* build up at least this many lines before flushing them out */
 #define	BUFFER_MARGIN		32
@@ -378,7 +378,7 @@ flush_blanks(void)
 		PUTC('\n');
 	if (half) {
 		PUTC('\033');
-		PUTC('\011');
+		PUTC('9');
 		if (!nb)
 			PUTC('\r');
 	}


More information about the svn-src-all mailing list