🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #151

Bug in pr (textutils 1.3)

#151
From: Andreas Schwab
Date: Wed, 15 Apr 1992 13:09
32 lines
1332 bytes
pr doesn't count lines correctly in print_page()

diff -ur orig/pr.c ./pr.c
--- orig/pr.c	Sun Jan  5 23:40:06 1992
+++ ./pr.c	Wed Apr 15 15:08:11 1992
@@ -1149,7 +1149,7 @@
 
   lines_left = double_space ? 2 * lines_per_body : lines_per_body;
 
-  for (; lines_left > 0 && ready_to_print > 0; --lines_left)
+  while (lines_left > 0 && ready_to_print > 0)
     {
       output_position = 0;
       spaces_not_printed = 0;
@@ -1177,7 +1177,10 @@
 	}
 
       if (print_vertical_padding)
-	putchar ('\n');
+	{
+	  putchar ('\n');
+	  --lines_left;
+	}
 
       if (double_space && pvp && extremities)
 	{

--
Andreas Schwab
schwab@ls5.informatik.uni-dortmund.de
---------------------------------------------------------------------------
Es besteht kein Grund zur Beruhigung -- Dieter Hildebrandt
Technical Details
Message-ID: <sh9uiINNoda@fbi-news.Informatik.Uni-Dortmund.DE>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mouton.informatik.uni-dortmund.de!schwab

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mouton.informatik.uni-dortmund.de!schwab
From: schwab@mouton.informatik.uni-dortmund.de (Andreas Schwab)
Subject: Bug in pr (textutils 1.3)
Message-ID: <sh9uiINNoda@fbi-news.Informatik.Uni-Dortmund.DE>
Sender: gnulists@ai.mit.edu
Reply-To: schwab@ls5.informatik.uni-dortmund.de
Organization: University of Dortmund, Germany
Distribution: gnu
Date: Wed, 15 Apr 1992 13:09:38 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 33