From 0cf78c5a5d14e1338c17a314ed8b3fcff0cb7bb4 Mon Sep 17 00:00:00 2001 From: mickey Date: Mon, 6 Jan 1997 11:06:45 +0000 Subject: [PATCH] add -r switch for onlcr translation --- usr.sbin/lpr/filters/lpf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/usr.sbin/lpr/filters/lpf.c b/usr.sbin/lpr/filters/lpf.c index 5335f316c56..d96414690ea 100644 --- a/usr.sbin/lpr/filters/lpf.c +++ b/usr.sbin/lpr/filters/lpf.c @@ -66,6 +66,7 @@ int length = 66; /* page length */ int indent; /* indentation length */ int npages = 1; int literal; /* print control characters */ +int onlcr; /* map nl->cr-nl */ char *name; /* user's login name */ char *host; /* user's machine name */ char *acctfile; /* accounting information file */ @@ -107,6 +108,10 @@ main(argc, argv) indent = atoi(&cp[2]); break; + case 'r': /* map nl->cr-nl */ + onlcr++; + break; + case 'c': /* Print control chars */ literal++; break; @@ -195,8 +200,11 @@ main(argc, argv) } if (i < maxrep) putc('\r', o); - else + else { + if (onlcr) + putc('\r', o); putc(ch, o); + } if (++lineno >= length) { fflush(o); npages++; -- 2.20.1