[net.bugs.4bsd] 4.[123]bsd tbl ".ne"eds too much

ado@elsie.UUCP (Arthur David Olson) (02/27/86)

Index:	src/tbl/t7.c Fix

Description:
	The "tbl" command may output a troff ".ne" directive that's larger
	than the size of the table being produced.

Repeat-By:
	Create a file with these lines (eliminating the leading indent):

		echo '
		.TS
		box ;
		l l .
		x
		_	_
		x
		.TE
		' | tbl | fgrep .ne

	(Note that the character between the two underscores above is a tab.)

	Now run the file through "sh" and note the result:

		.ne 3v+0p

	Next edit the above file, changing the line with the two underscores
	to a line with just a single underscore on it.  Run the file through
	"sh" again and note the result:

		.ne 2v+2p

	Even though the two versions of the file produce identical-looking
	output when "typeset," the size that tbl claims is needed is different.

Fix:
	Here's the fix to the 4.1bsd version of "src/tbl/t7.c".  As usual,
	the trade secret status of the code involved precludes a clearer
	posting.  The fix is an addition to the function "need",
	conditioned on "OLDVERSION":

			...
			if (instead[i]!=0)
				continue;
			else
		#ifndef OLDVERSION
			if (allh(i))
				horlin++;
			else
		#endif
				texlin++;
			...
--
Bugs is a Warner Brothers trademark.
Bug is a Volkswagen of America trademark (writes Martin Minow).
--
	UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado@seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks