summaryrefslogtreecommitdiff
path: root/usr.bin/pr
diff options
context:
space:
mode:
authorimp <imp@cvs.openbsd.org>1996-08-10 04:41:01 +0000
committerimp <imp@cvs.openbsd.org>1996-08-10 04:41:01 +0000
commit38dce555330993cb2269b45ec59601cf893387f0 (patch)
tree40991acd6881d1c0c798be85c0485b6bae6f0b73 /usr.bin/pr
parentf593b8b13cc6964958e328c58cc32ce8d4f2618b (diff)
pr -F would sometimes fail to properly use formfeeds.
Diffstat (limited to 'usr.bin/pr')
-rw-r--r--usr.bin/pr/pr.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index 56d23cf7d03..e50f46efabf 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pr.c,v 1.2 1996/06/26 05:37:54 deraadt Exp $ */
+/* $OpenBSD: pr.c,v 1.3 1996/08/10 04:41:00 imp Exp $ */
/*-
* Copyright (c) 1991 Keith Muller.
@@ -45,7 +45,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$OpenBSD: pr.c,v 1.2 1996/06/26 05:37:54 deraadt Exp $";
+static char *rcsid = "$OpenBSD: pr.c,v 1.3 1996/08/10 04:41:00 imp Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -1464,13 +1464,21 @@ prtail(cnt, incomp)
/*
* only pad with no headers when incomplete last line
*/
- if (!incomp)
- return(0);
- if ((dspace && (putchar('\n') == EOF)) ||
- (putchar('\n') == EOF)) {
+ if (incomp &&
+ ((dspace && (putchar('\n') == EOF)) ||
+ (putchar('\n') == EOF))) {
pfail();
return(1);
}
+ /*
+ * but honor the formfeed request
+ */
+ if (formfeed) {
+ if (putchar('\f') == EOF) {
+ pfail();
+ return(1);
+ }
+ }
return(0);
}