summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/filters/lpf.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-01-06 11:06:46 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-01-06 11:06:46 +0000
commit5877f54f4c004d9dc370fcfbba40e881b1451d5d (patch)
tree764a01009bb8ca4b915efbf8ed49cf9e73197410 /usr.sbin/lpr/filters/lpf.c
parentd8a933071cdde62a068b41a54045707aa214adad (diff)
add -r switch for onlcr translation
Diffstat (limited to 'usr.sbin/lpr/filters/lpf.c')
-rw-r--r--usr.sbin/lpr/filters/lpf.c10
1 files changed, 9 insertions, 1 deletions
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++;