Subject: Bug in cmp(1) (fwd)
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:41:02
I forgot to mention that I'm running NetBSD-current of around 5th March 1994.

Forwarded message:
> From rsk Fri Mar 25 11:37:47 1994
> Subject: Bug in cmp(1)
> To: netbsd-bugs@sun-lamp.cs.berkeley.edu
> Date: Fri, 25 Mar 1994 11:37:47 +0000 (GMT)
> X-Mailer: ELM [version 2.4 PL23]
> Content-Type: text
> Content-Length: 583       
> 
> 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
> 
> 


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