Subject: Bug in cmp(1)
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Bob Kemp <rsk@ecs.soton.ac.uk>
List: netbsd-bugs
Date: 03/25/1994 11:37:47
Sorry, I don't have send-pr here nor a NetBSD m/c on the internet, so...

Description:
	"cat file1 | cmp - file2" only works for small files but
	"cmp - file1 < file2" works fine.

	The former gives the message that the files differ at character 4097,
	even if file1 == file2 !
	It looks like a problem with reads on a pipe -- cmp doesn't realise
	it must do ultiple reads to fill its buffer.

Repeat-By:
	Create a file, In say, of about 10k (say).  More than 4k anyhow.

	cmp In In			# works fine
	cat In | cmp - In		# produces an error message
	cmp - In < In			# works fine

Bob


------------------------------------------------------------------------------