Bug 18597 - cmp(1) failure
Summary: cmp(1) failure
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: ps
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-16 13:20 UTC by mellon
Modified: 2002-04-08 14:46 UTC (History)
0 users

See Also:


Attachments
file.diff (593 bytes, patch)
2000-05-16 13:20 UTC, mellon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.