🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Doug Gwyn Wed, 16 Mar 1988 12:46
DWB troff font bug
#727
Author: Doug Gwyn
Date: Wed, 16 Mar 1988 12:46
29 lines
1217 bytes
When we expanded troff to support more fonts, a horrible bug surfaced.
When the device had more than 18 fonts, font 'B' got mapped to the
wrong font position!  This bug appears in both DWB 1.0 and DWB 2.0
versions of device-independent troff, in source file t6.c (normally
found in a source directory named "troff.d").  The faulty function
"findft" is identical in both DWB releases.  Here's the fixed function:

findft(i)
register int	i;
{
#if 0	/* DAG -- horrible bug! */
	register k;

	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
#else
	register int k, m;

	if (i >= '0' && i <= '9'
	 && (k = i - '0') <= nfonts && k < smnt
	 || (k = (i & 0xFF00) >> 8) >= '0' && k <= '9'
	 && (m = i & 0xFF) >= '0' && m <= '9'
	 && (k = m - '0' + 10 * (k - '0')) <= nfonts && k < smnt)
#endif
		return(k);
	for (k = 0; fontlab[k] != i; k++)
		if (k > nfonts)
			return(-1);
	return(k);
}
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