🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Eric Backus Fri, 07 Aug 1992 21:17
Bug in fold program from textutils-1.3
#217
Author: Eric Backus
Date: Fri, 07 Aug 1992 21:17
34 lines
1527 bytes
The 'fold' program found in textutils-1.3 folds lines to one character
less than is requested.  For example, it creates 79-character lines
when 80 characters is the requested width.  If you request a linewidth
of one ("fold -w1 myfile.txt"), the fold program goes into an infinite
loop.

Neigher of these behaviors is seen with the 'fold' program found on
HP-UX 8.0, so I assume they are bugs.

Following is a one-line patch to fix the problem.
--
				Eric Backus
				ericb%hplsla@hplabs.hp.com
				(206) 335-2495

*** textutils-1.3/src/fold.c	Fri Aug  7 14:07:13 1992
--- textutils-1.3/src/fold.c.orig	Fri Aug  7 14:05:39 1992
***************
*** 155,161 ****
      rescan:
        column = adjust_column (column, c);
  
!       if (column > width)
  	{
  	  /* This character would make the line too long.
  	     Print the line plus a newline, and make this character
--- 155,161 ----
      rescan:
        column = adjust_column (column, c);
  
!       if (column >= width)
  	{
  	  /* This character would make the line too long.
  	     Print the line plus a newline, and make this character
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