🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Col. G. L. Sicherman Wed, 08 Oct 1986 14:19
fix to colcrt - fold unders onto blanks
#1693
Author: Col. G. L. Sicherman
Date: Wed, 08 Oct 1986 14:19
56 lines
1927 bytes
As the man page for colcrt(1) says under BUGS, underlines ought to be
folded onto blanks, BUT blah blah blah!  What we want is to view a line
like

	Has anybody seen my foo_bar?

as itself, and not as

	Has anybody seen my foo bar?
	                       -

Here are diffs to do it.  The line numbers may be off a bit.  As usual,
the proprietary etc. precludes etc. clearer posting.  A minor tradeoff
is that if you really feed Example 2 in, you'll get Example 1 out.

!38a33
!> char	dontsplitbl;
!59a55,57
!> 			case 'b':
!> 				dontsplitbl = 1;
!> 				break;
!61c59
!< 				printf("usage: %s [ - ] [ -2 ] [ file ... ]\n", progname);
!---
!> 				printf("usage: %s [ - ] [ -2 ] [ -b ] [ file ... ]\n", progname);
!185a183,184
!> 		if (dontsplitbl && i%2 != 0 && canmerge(page[i],page[i+1]))
!> 			merge(page[i],page[i+1]);
!224a224,246
!> 
!> /*
!>  *	The Colonel's stuff.
!>  */
!> 
!> int
!> canmerge(a,b)
!> char a[132], b[132];
!> {
!> 	register int i;
!> 	for (i=0; a[i] && b[i] && i<132; i++)
!> 		if ((' '!=a[i] || '-'!=b[i]) && ' '!=b[i]) return 0;
!> 	return 1;
!> }
!> 
!> merge(a,b)
!> char a[132], b[132];
!> {
!> 	register int i;
!> 	for (i=0; b[i] && i<132; i++)
!> 		if (' '==a[i] || !a[i]) a[i] = '-'==b[i]? '_': b[i];
!> 	bzero(b,132);
-- 
Col. G. L. Sicherman
UU: ...{rocksvax|decvax}!sunybcs!colonel
CS: colonel@buffalo-cs
BI: colonel@sunybcs, csdsiche@sunyabvc
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