From f6240da93cb925b69bad68f1d9750fecd8a4b555 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 1 May 2015 17:18:07 +0000 Subject: [PATCH] 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 --- usr.bin/col/col.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c index e811a5247c6c..511188a89ffe 100644 --- a/usr.bin/col/col.c +++ b/usr.bin/col/col.c @@ -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'); }