From imp@village.org  Thu May 23 00:29:40 1996
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <imp@village.org>
Reply-To: imp@village.org
To: FreeBSD-gnats-submit@freebsd.org
Subject:
X-Send-Pr-Version: 3.2

>Number:         1237
>Category:       bin
>Synopsis:       
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 23 00:30:01 PDT 1996
>Closed-Date:    Mon Oct 21 21:47:24 PDT 1996
>Last-Modified:  Tue Nov 27 18:53:11 PST 2001
>Originator:     Warner Losh
>Release:        FreeBSD 2.1.0-RELEASE i386
>Organization:
Warner Losh                                                     imp@village.org
>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);
 	}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: scrappy 
State-Changed-When: Mon Oct 21 21:47:24 PDT 1996 
State-Changed-Why:  

patch applied to 2.2 src tree 

>Unformatted:
no
pr doesn't honor -F when -t is specified
non-critical
low
