Bug 18597

Summary: cmp(1) failure
Product: Base System Reporter: mellon <mellon>
Component: binAssignee: ps
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description mellon 2000-05-16 13:20:05 UTC
cmp -s will produce incorrect results when skips are given.

This one appears to have been with us since ancient times.

Fix: Note that eofmsg() checks sflag, so moving the
test is okay.

I have verified that cmp(1) on Solaris behaves
identically in the test above.

Note 1 -> DIFF_EXIT .
How-To-Repeat: 
bash-2.03$ cat >f1
abc
bash-2.03$ cat >f2
bc
bash-2.03$ cmp f1 f2 1 0
bash-2.03$ echo $?
0
bash-2.03$ cmp -s f1 f2 1 0
bash-2.03$ echo $?
1
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-20 12:20:27 UTC
Responsible Changed
From-To: freebsd-bugs->ps

Paul has fixed this in HEAD and RELENG_4.  Since I'm not sure 
whether he plans to merge the fix onto RELENG_3, I'm leaving 
the PR for him to close.
Comment 2 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2002-04-08 14:13:35 UTC
State Changed
From-To: open->analyzed

Committed to RELENG_3 as well. 

Thanks.
Comment 3 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2002-04-08 14:46:10 UTC
State Changed
From-To: analyzed->closed

This should have been closed, not analyzed. 

For the record it was not ps, but green who committed those changes.