From owner-freebsd-bugs Thu May 23 00:30:07 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA02145 for bugs-outgoing; Thu, 23 May 1996 00:30:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA02118; Thu, 23 May 1996 00:30:03 -0700 (PDT) Resent-Date: Thu, 23 May 1996 00:30:03 -0700 (PDT) Resent-Message-Id: <199605230730.AAA02118@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, imp@village.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id AAA02054 for ; Thu, 23 May 1996 00:29:39 -0700 (PDT) Received: (from imp@localhost) by rover.village.org (8.7.5/8.6.6) id BAA08144; Thu, 23 May 1996 01:29:37 -0600 (MDT) Message-Id: <199605230729.BAA08144@rover.village.org> Date: Thu, 23 May 1996 01:29:37 -0600 (MDT) From: Warner Losh Reply-To: imp@village.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1237: Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1237 >Category: bin >Synopsis: >Confidential: yes >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 23 00:30:01 PDT 1996 >Last-Modified: >Originator: Warner Losh >Organization: Warner Losh imp@village.org >Release: FreeBSD 2.1.0-RELEASE i386 >Environment: >Description: 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. >How-To-Repeat: lpr -l 20 -F -t < long-file | more You will notice that you don't get form feeds often enough >Fix: The following patch should fix the problem. It honors the request for form feeds in all the right places. Index: pr.c =================================================================== RCS file: /home/imp/FreeBSD/CVS/src/usr.bin/pr/pr.c,v retrieving revision 1.2 diff -u -r1.2 pr.c --- pr.c 1995/05/30 06:32:58 1.2 +++ pr.c 1996/05/23 07:23:20 @@ -1457,12 +1457,20 @@ /* * 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); } >Audit-Trail: >Unformatted: no pr doesn't honor -F when -t is specified non-critical low