🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Andreas Schwab Wed, 15 Apr 1992 13:09
Bug in pr (textutils 1.3)
#151
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads