Defect report from : Paul Eggert , UCLA
(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
@ page 254 line 9920 section cmp objection {20060509a}
Problem:
Edition of Specification (Year): 2004
Defect code : 1. Error
POSIX requires that the command 'cmp -l file1 file2' must output the
"cmp: EOF on shorterfile" diagnostic message if file1 and file2 are
identical for the entire length of the shorter file. However, in
practice this command outputs the diagnostic message whenever file1
and file2 differ in length, even when their common prefixes differ.
For example:
$ echo a >file1
$ echo bc >file2
$ cmp -l file1 file2
1 141 142
2 12 143
cmp: EOF on file1
I checked 7th Edition Unix, OpenBSD 3.4, GNU diffutils CVS, and
Solaris 10, and they all output the EOF message in this case.
Evidently this is an inadvertent error in the standard.
Action:
Change the condition for when the EOF diagnostic is written, as
follows.
In XCU page 254, change lines 9919-9920 from:
If file1 and file2 are identical for the entire length of the
shorter file, in the POSIX locale the following diagnostic message
shall be written, unless the -s option is specified:
to:
If the -l option is used and file1 and file2 differ in length, or
if the -s option is not used and file1 and file2 are identical for
the entire length of the shorter file, in the POSIX locale the
following diagnostic message shall be written:
|