Defect report from : Paul Eggert , Twin Sun, Inc
(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
@ page 320 line 12320 section diff objection {eggert20020514a}
Problem:
Defect code : 1. Error
OSIX specifies a behavior for 'diff -c' that does not agree with
existing practice when contexts that contain zero lines or one line.
Here is an example, showing current existing practice:
$ touch empty
$ echo hello >oneline
$ /usr/bin/diff -c empty oneline
*** empty Fri May 10 12:22:48 2002
--- oneline Fri May 10 12:22:58 2002
***************
*** 0 ****
--- 1 ----
+ hello
POSIX does not allow this behavior: it requires that two line numbers
must appear in each line range of output. That is, POSIX presumably
would require output that looked like this instead:
*** empty Fri May 10 12:22:48 2002
--- oneline Fri May 10 12:22:58 2002
***************
*** 1,0 ****
--- 1,1 ----
+ hello
No "diff" implementations behave that way, though.
Also, POSIX does not specify how to determine the line number
of an empty range.
Action:
Change XCU page 320 lines 12320-12321 to read:
Next, the range of lines in file1 shall be written in the following
format if the range contains two or more lines:
"*** %d,%d ****\n", <beginning line number>, <ending line number>
and the following format otherwise:
"*** %d ****\n", <ending line number>
The ending line number of an empty range shall be the number of the
preceding line, or 0 if the range is at the start of the file.
Change XCU page 321 lines 12329-12330 to read:
Next, the range of lines in file2 shall be written in the following
format if the range contains two or more lines:
"--- %d,%d ----\n", <beginning line number>, <ending line number>
and the following format otherwise:
"--- %d ----\n", <ending line number>
|