From: mickey Date: Mon, 6 Jan 1997 11:06:45 +0000 (+0000) Subject: add -r switch for onlcr translation X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0cf78c5a5d14e1338c17a314ed8b3fcff0cb7bb4;p=openbsd add -r switch for onlcr translation --- 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++;