Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 1996 01:29:37 -0600 (MDT)
From:      Warner Losh <imp@village.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1237: 
Message-ID:  <199605230729.BAA08144@rover.village.org>
Resent-Message-ID: <199605230730.AAA02118@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605230729.BAA08144>