diff options
author | scrappy <scrappy@FreeBSD.org> | 1996-10-22 05:02:01 +0000 |
---|---|---|
committer | scrappy <scrappy@FreeBSD.org> | 1996-10-22 05:02:01 +0000 |
commit | cc11d2ef51aa33a4eb61d83f6d75b90daed22aa2 (patch) | |
tree | 3c50e34a8eedb28a304f09d5647ffb90d2676b28 /usr.bin/pr/pr.c | |
parent | 66f320435d6b1ff226eb8acc713050ee757b42a8 (diff) | |
download | FreeBSD-src-cc11d2ef51aa33a4eb61d83f6d75b90daed22aa2.zip FreeBSD-src-cc11d2ef51aa33a4eb61d83f6d75b90daed22aa2.tar.gz |
Fixes:
When you ask pr to use form feeds at the end of pages and specify a page
length and tell pr to not put the fancy headers and footers on each
pages, then pr will not separate the pages with a form feed.
Closes PR: bin/1237
Submitted by: Warner Losh <imp@village.org>
Diffstat (limited to 'usr.bin/pr/pr.c')
-rw-r--r-- | usr.bin/pr/pr.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 3da319c..decaaed 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1457,16 +1457,23 @@ 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); } - /* * if double space output two \n */ |