summaryrefslogtreecommitdiffstats
path: root/usr.bin/col/col.c
diff options
context:
space:
mode:
authormikeh <mikeh@FreeBSD.org>2001-06-17 04:24:16 +0000
committermikeh <mikeh@FreeBSD.org>2001-06-17 04:24:16 +0000
commit714cc67ab669e57482b4991f6b38771231a73aca (patch)
tree8db6603063905c27d9d4de94ac61e41842b9e159 /usr.bin/col/col.c
parent8174fd75ca03de898fc2e94ccc9a0e0315851d4f (diff)
downloadFreeBSD-src-714cc67ab669e57482b4991f6b38771231a73aca.zip
FreeBSD-src-714cc67ab669e57482b4991f6b38771231a73aca.tar.gz
Add the -p flag to force unknown control sequences to be passed
through unchanged. Reviewed by: silence on -audit Obtained from: NetBSD MFC after: 3 weeks
Diffstat (limited to 'usr.bin/col/col.c')
-rw-r--r--usr.bin/col/col.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index aed79bd..609b788 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -110,6 +110,7 @@ int fine; /* if `fine' resolution (half lines) */
int max_bufd_lines; /* max # lines to keep in memory */
int nblank_lines; /* # blanks after last flushed line */
int no_backspaces; /* if not to output any backspaces */
+int pass_unknown_seqs; /* pass unknown control sequences */
#define PUTC(ch) \
do { \
@@ -138,7 +139,7 @@ main(argc, argv)
max_bufd_lines = 128;
compress_spaces = 1; /* compress spaces into tabs */
- while ((opt = getopt(argc, argv, "bfhl:x")) != -1)
+ while ((opt = getopt(argc, argv, "bfhl:px")) != -1)
switch (opt) {
case 'b': /* do not output backspaces */
no_backspaces = 1;
@@ -153,6 +154,9 @@ main(argc, argv)
if ((max_bufd_lines = atoi(optarg)) <= 0)
errx(1, "bad -l argument %s", optarg);
break;
+ case 'p': /* pass unknown control sequences */
+ pass_unknown_seqs = 1;
+ break;
case 'x': /* do not compress spaces into tabs */
compress_spaces = 0;
break;
@@ -220,7 +224,8 @@ main(argc, argv)
cur_line -= 2;
continue;
}
- continue;
+ if (!pass_unknown_seqs)
+ continue;
}
/* Must stuff ch in a line - are we at the right one? */
@@ -530,7 +535,7 @@ void
usage()
{
- (void)fprintf(stderr, "usage: col [-bfhx] [-l nline]\n");
+ (void)fprintf(stderr, "usage: col [-bfhpx] [-l nline]\n");
exit(1);
}
OpenPOWER on IntegriCloud