From jeremyp@gsmx07.alcatel.com.au Mon Oct 25 20:28:13 1999
Return-Path: <jeremyp@gsmx07.alcatel.com.au>
Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10])
	by hub.freebsd.org (Postfix) with ESMTP id 54D3514DD6
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Oct 1999 20:28:07 -0700 (PDT)
	(envelope-from jeremyp@gsmx07.alcatel.com.au)
Received: by border.alcanet.com.au id <40340>; Tue, 26 Oct 1999 13:23:12 +1000
Message-Id: <99Oct26.132312est.40340@border.alcanet.com.au>
Date: Tue, 26 Oct 1999 13:28:01 +1000
From: Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
Reply-To: peter.jeremy@alcatel.com.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: Printed manual pages have extraneous blank first page
X-Send-Pr-Version: 3.2

>Number:         14530
>Category:       docs
>Synopsis:       Printed manual pages have extraneous blank first page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    phantom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 25 20:30:00 PDT 1999
>Closed-Date:    Sun Oct 29 13:00:48 PST 2000
>Last-Modified:  Sun Oct 29 13:02:37 PST 2000
>Originator:     Peter Jeremy
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:

	cvs-cur 5781, but this problem also exists in -stable

>Description:

	Printed postscript manual pages start with an extraneous blank
	page.

>How-To-Repeat:

	gzcat /usr/share/man/man3/cam.3.gz | groff -man | lp
	(or send output to ghostscript or similar).
	The first page is blank except for the footer line and the
	actual manual page begins on page 2.

>Fix:

	gtroff appears to generate extraneous blank output for lines like
.	el .ie "\\$2"3.0"       \c
	This causes the `.Os FreeBSD 3.0' line in the above example (and
	similar lines in many other FreeBSD man pages) to begin a page,
	which is then flushed by one of the later directives (probably
	either .Dt or .Sh).  The following patch changes the logic from
		if (foo1) { } else if (foo2) { } ...
	to
		if (!foo1) if (!foo2) ...
	avoiding the need to insert an empty `then' clause.

	The code for the Fx macro is similar and an equivalent patch
	is appended, though this latter patch hasn't been verified.

	A positive side-effect of the patch is to remove a number of
	"unbalanced .el request" warnings if -ww is enabled.

Index: doc-common
===================================================================
RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-common,v
retrieving revision 1.17
diff -u -r1.17 doc-common
--- doc-common	1999/09/22 21:38:40	1.17
+++ doc-common	1999/10/26 03:03:20
@@ -230,31 +230,31 @@
 .\}
 .if "\\$1"FreeBSD" \{\
 .	if "\\$2"2"      .ds oS FreeBSD 2.0
-.	    ie \\n(.$==1        \c
-.	el .ie "\\$2"1.0"       \c
-.	el .ie "\\$2"1.1"       \c
-.	el .ie "\\$2"1.1.5"     \c
-.	el .ie "\\$2"1.1.5.1"   \c
-.	el .ie "\\$2"2"         \c
-.	el .ie "\\$2"2.0"       \c
-.	el .ie "\\$2"2.0.5"     \c
-.	el .ie "\\$2"2.1"       \c
-.	el .ie "\\$2"2.1.5"     \c
-.	el .ie "\\$2"2.1.6"     \c
-.	el .ie "\\$2"2.1.7"     \c
-.	el .ie "\\$2"2.2"       \c
-.	el .ie "\\$2"2.2.1"     \c
-.	el .ie "\\$2"2.2.2"     \c
-.	el .ie "\\$2"2.2.5"     \c
-.	el .ie "\\$2"2.2.6"     \c
-.	el .ie "\\$2"2.2.7"     \c
-.	el .ie "\\$2"2.2.8"     \c
-.	el .ie "\\$2"3.0"       \c
-.	el .ie "\\$2"3.1"       \c
-.	el .ie "\\$2"3.2"       \c
-.	el .ie "\\$2"3.3"       \c
-.	el .ie "\\$2"4.0"       \c
-.	el .tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
+.	if !\\n(.$==1        \
+.	if !"\\$2"1.0"       \
+.	if !"\\$2"1.1"       \
+.	if !"\\$2"1.1.5"     \
+.	if !"\\$2"1.1.5.1"   \
+.	if !"\\$2"2"         \
+.	if !"\\$2"2.0"       \
+.	if !"\\$2"2.0.5"     \
+.	if !"\\$2"2.1"       \
+.	if !"\\$2"2.1.5"     \
+.	if !"\\$2"2.1.6"     \
+.	if !"\\$2"2.1.7"     \
+.	if !"\\$2"2.2"       \
+.	if !"\\$2"2.2.1"     \
+.	if !"\\$2"2.2.2"     \
+.	if !"\\$2"2.2.5"     \
+.	if !"\\$2"2.2.6"     \
+.	if !"\\$2"2.2.7"     \
+.	if !"\\$2"2.2.8"     \
+.	if !"\\$2"3.0"       \
+.	if !"\\$2"3.1"       \
+.	if !"\\$2"3.2"       \
+.	if !"\\$2"3.3"       \
+.	if !"\\$2"4.0"       \
+.	tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
 .\}
 .if "\\*(oS"Null" \{\
 .	ds oS \&\\$1
Index: doc-syms
===================================================================
RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-syms,v
retrieving revision 1.22
diff -u -r1.22 doc-syms
--- doc-syms	1999/09/07 10:33:34	1.22
+++ doc-syms	1999/10/26 03:02:39
@@ -160,29 +160,29 @@
 .ds aa \&\f\\n(cF\s\\n(cZ
 .ds ab \& \&
 .    ie \\n(.$==0       .rm ab
-.el .ie "\\$1"1.0"      \c
-.el .ie "\\$1"1.1"      \c
-.el .ie "\\$1"1.1.5"    \c
-.el .ie "\\$1"1.1.5.1"  \c
-.el .ie "\\$1"2.0"      \c
-.el .ie "\\$1"2.0.5"    \c
-.el .ie "\\$1"2.1"      \c
-.el .ie "\\$1"2.1.5"    \c
-.el .ie "\\$1"2.1.6"    \c
-.el .ie "\\$1"2.1.7"    \c
-.el .ie "\\$1"2.2"      \c
-.el .ie "\\$1"2.2.1"    \c
-.el .ie "\\$1"2.2.2"    \c
-.el .ie "\\$1"2.2.5"    \c
-.el .ie "\\$1"2.2.6"    \c
-.el .ie "\\$1"2.2.7"    \c
-.el .ie "\\$1"2.2.8"    \c
-.el .ie "\\$1"3.0"      \c
-.el .ie "\\$1"3.1"      \c
-.el .ie "\\$1"3.2"      \c
-.el .ie "\\$1"3.3"      \c
-.el .ie "\\$1"4.0"      \c
-.el .ie "\\$1","        .rm ab \" Allow ".Fx ,"
+.el .if !"\\$1"1.0"     \
+.    if !"\\$1"1.1"     \
+.    if !"\\$1"1.1.5"   \
+.    if !"\\$1"1.1.5.1" \
+.    if !"\\$1"2.0"     \
+.    if !"\\$1"2.0.5"   \
+.    if !"\\$1"2.1"     \
+.    if !"\\$1"2.1.5"   \
+.    if !"\\$1"2.1.6"   \
+.    if !"\\$1"2.1.7"   \
+.    if !"\\$1"2.2"     \
+.    if !"\\$1"2.2.1"   \
+.    if !"\\$1"2.2.2"   \
+.    if !"\\$1"2.2.5"   \
+.    if !"\\$1"2.2.6"   \
+.    if !"\\$1"2.2.7"   \
+.    if !"\\$1"2.2.8"   \
+.    if !"\\$1"3.0"     \
+.    if !"\\$1"3.1"     \
+.    if !"\\$1"3.2"     \
+.    if !"\\$1"3.3"     \
+.    if !"\\$1"4.0"     \
+.    ie "\\$1","        .rm ab \" Allow ".Fx ,"
 .el .ie "\\$1"."        .rm ab \" Allow ".Fx ."
 .el .tm Unknown FreeBSD version ``\\$1'' at line \\n(c.
 \&\\*(tNFreeBSD\\*(aa\\*(ab\\$1\\$2

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->phantom 
Responsible-Changed-By: phantom 
Responsible-Changed-When: Mon Jan 10 03:33:21 PST 2000 
Responsible-Changed-Why:  
I'll be working on this problem. 

From: Peter Jeremy <peter.jeremy@alcatel.com.au>
To: nik@FreeBSD.ORG
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: docs/14530: Printed manual pages have extraneous blank first page
Date: Thu, 27 Jan 2000 07:37:16 +1100

 Hi Nik,
 
 In view of the upcoming code freeze for 4.0-RELEASE, could you please
 consider applying the following patch, which is an updated version of
 the one included in PR docs/14530.  This patch corrects a problem
 which causes printed man pages to begin with a blank page.
 
 Index: src/contrib/groff/tmac/doc-common
 ===================================================================
 RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-common,v
 retrieving revision 1.19
 diff -u -r1.19 doc-common
 --- src/contrib/groff/tmac/doc-common	2000/01/12 10:26:30	1.19
 +++ src/contrib/groff/tmac/doc-common	2000/01/13 13:47:19
 @@ -231,35 +231,33 @@
  .\}
  .if "\\$1"FreeBSD" \{\
  .	if "\\$2"2"      .ds oS FreeBSD 2.0
 -.	    ie \\n(.$==1        \c
 -.	el .ie "\\$2"1.0"       \c
 -.	el .ie "\\$2"1.1"       \c
 -.	el .ie "\\$2"1.1.5"     \c
 -.	el .ie "\\$2"1.1.5.1"   \c
 -.	el .ie "\\$2"2"         \c
 -.	el .ie "\\$2"2.0"       \c
 -.	el .ie "\\$2"2.0.5"     \c
 -.	el .ie "\\$2"2.1"       \c
 -.	el .ie "\\$2"2.1.5"     \c
 -.	el .ie "\\$2"2.1.6"     \c
 -.	el .ie "\\$2"2.1.7"     \c
 -.	el .ie "\\$2"2.2"       \c
 -.	el .ie "\\$2"2.2.1"     \c
 -.	el .ie "\\$2"2.2.2"     \c
 -.	el .ie "\\$2"2.2.5"     \c
 -.	el .ie "\\$2"2.2.6"     \c
 -.	el .ie "\\$2"2.2.7"     \c
 -.	el .ie "\\$2"2.2.8"     \c
 -.	el .ie "\\$2"3"         \c
 -.	el .ie "\\$2"3.0"       \c
 -.	el .ie "\\$2"3.1"       \c
 -.	el .ie "\\$2"3.2"       \c
 -.	el .ie "\\$2"3.3"       \c
 -.	el .ie "\\$2"3.4"       \c
 -.	el .ie "\\$2"3.5"       \c
 -.	el .ie "\\$2"4"         \c
 -.	el .ie "\\$2"4.0"       \c
 -.	el .tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
 +.	if !\\n(.$==1        \
 +.	if !"\\$2"1.0"       \
 +.	if !"\\$2"1.1"       \
 +.	if !"\\$2"1.1.5"     \
 +.	if !"\\$2"1.1.5.1"   \
 +.	if !"\\$2"2"         \
 +.	if !"\\$2"2.0"       \
 +.	if !"\\$2"2.0.5"     \
 +.	if !"\\$2"2.1"       \
 +.	if !"\\$2"2.1.5"     \
 +.	if !"\\$2"2.1.6"     \
 +.	if !"\\$2"2.1.7"     \
 +.	if !"\\$2"2.2"       \
 +.	if !"\\$2"2.2.1"     \
 +.	if !"\\$2"2.2.2"     \
 +.	if !"\\$2"2.2.5"     \
 +.	if !"\\$2"2.2.6"     \
 +.	if !"\\$2"2.2.7"     \
 +.	if !"\\$2"2.2.8"     \
 +.	if !"\\$2"3.0"       \
 +.	if !"\\$2"3.1"       \
 +.	if !"\\$2"3.2"       \
 +.	if !"\\$2"3.3"       \
 +.	if !"\\$2"3.4"       \
 +.	if !"\\$2"3.5"       \
 +.	if !"\\$2"4.0"       \
 +.	tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
  .\}
  .if "\\*(oS"Null" \{\
  .	ds oS \&\\$1
 Index: src/contrib/groff/tmac/doc-syms
 ===================================================================
 RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-syms,v
 retrieving revision 1.24
 diff -u -r1.24 doc-syms
 --- src/contrib/groff/tmac/doc-syms	2000/01/12 10:26:30	1.24
 +++ src/contrib/groff/tmac/doc-syms	2000/01/13 13:47:19
 @@ -161,31 +161,31 @@
  .ds aa \&\f\\n(cF\s\\n(cZ
  .ds ab \& \&
  .    ie \\n(.$==0       .rm ab
 -.el .ie "\\$1"1.0"      \c
 -.el .ie "\\$1"1.1"      \c
 -.el .ie "\\$1"1.1.5"    \c
 -.el .ie "\\$1"1.1.5.1"  \c
 -.el .ie "\\$1"2.0"      \c
 -.el .ie "\\$1"2.0.5"    \c
 -.el .ie "\\$1"2.1"      \c
 -.el .ie "\\$1"2.1.5"    \c
 -.el .ie "\\$1"2.1.6"    \c
 -.el .ie "\\$1"2.1.7"    \c
 -.el .ie "\\$1"2.2"      \c
 -.el .ie "\\$1"2.2.1"    \c
 -.el .ie "\\$1"2.2.2"    \c
 -.el .ie "\\$1"2.2.5"    \c
 -.el .ie "\\$1"2.2.6"    \c
 -.el .ie "\\$1"2.2.7"    \c
 -.el .ie "\\$1"2.2.8"    \c
 -.el .ie "\\$1"3.0"      \c
 -.el .ie "\\$1"3.1"      \c
 -.el .ie "\\$1"3.2"      \c
 -.el .ie "\\$1"3.3"      \c
 -.el .ie "\\$1"3.4"      \c
 -.el .ie "\\$1"3.5"      \c
 -.el .ie "\\$1"4.0"      \c
 -.el .ie "\\$1","        .rm ab \" Allow ".Fx ,"
 +.el .if !"\\$1"1.0"     \
 +.    if !"\\$1"1.1"     \
 +.    if !"\\$1"1.1.5"   \
 +.    if !"\\$1"1.1.5.1" \
 +.    if !"\\$1"2.0"     \
 +.    if !"\\$1"2.0.5"   \
 +.    if !"\\$1"2.1"     \
 +.    if !"\\$1"2.1.5"   \
 +.    if !"\\$1"2.1.6"   \
 +.    if !"\\$1"2.1.7"   \
 +.    if !"\\$1"2.2"     \
 +.    if !"\\$1"2.2.1"   \
 +.    if !"\\$1"2.2.2"   \
 +.    if !"\\$1"2.2.5"   \
 +.    if !"\\$1"2.2.6"   \
 +.    if !"\\$1"2.2.7"   \
 +.    if !"\\$1"2.2.8"   \
 +.    if !"\\$1"3.0"     \
 +.    if !"\\$1"3.1"     \
 +.    if !"\\$1"3.2"     \
 +.    if !"\\$1"3.3"     \
 +.    if !"\\$1"3.4"     \
 +.    if !"\\$1"3.5"     \
 +.    if !"\\$1"4.0"     \
 +.    ie "\\$1","        .rm ab \" Allow ".Fx ,"
  .el .ie "\\$1"."        .rm ab \" Allow ".Fx ."
  .el .tm Unknown FreeBSD version ``\\$1'' at line \\n(c.
  \&\\*(tNFreeBSD\\*(aa\\*(ab\\$1\\$2
 
 Peter
 
State-Changed-From-To: open->closed 
State-Changed-By: nik 
State-Changed-When: Sun Oct 29 13:00:48 PST 2000 
State-Changed-Why:  
Fixed.  I think this was by Joerg in 1.20 of contrib/groff/tmac/doc-common. 
Thanks for the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14530 
>Unformatted:
