Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 beta 3/9/83; site trigraph.UUCP
Path: utzoo!dciem!trigraph!greg
From: greg@trigraph.UUCP (Gregory Hill)
Newsgroups: net.bugs.4bsd
Subject: bug in pr(1)
Message-ID: <156@trigraph.UUCP>
Date: Mon, 7-Jan-85 11:20:51 EST
Article-I.D.: trigraph.156
Posted: Mon Jan  7 11:20:51 1985
Date-Received: Mon, 7-Jan-85 22:17:14 EST
Organization: Trigraph, Toronto
Lines: 16


Description:
	There is a bug in the V7 and 4.2BSD pr(1) command that occurs
	very rarely: the first character of a page is printed incorrectly.
	(The -m option is not used.)
Repeated by:
	Very difficult: create a file that has more than 6720 characters and
	the 6720th character of the file occurs at the start of a page.
	This character will be printed incorrectly.
Solution:
	The print() routine calls tpgetc() to check if there is any more
	file to print before printing out the header. When backing up the input
	to actual print the character, one of the statements used is:
		colp[ncol] = &buffers[BUFS];
	The statement should be:
		colp[ncol] = &buffers[BUFS] - 1;