[PATCH] diff portability fixes

Denys Vlasenko vda.linux at googlemail.com
Wed Feb 3 23:12:14 UTC 2010


On Tuesday 02 February 2010 20:22, Dan Fandrich wrote:
> The recent rewrite of the diff applet has introduced several unnecessary
> C99isms. This patch removes them to improve portability across compilers.

There is a simple bug in the patch:

# cd testsuite
# ./runtest diff
Segmentation fault
FAIL: diff of stdin
Segmentation fault
FAIL: diff of stdin, no newline in the file
PASS: diff of stdin, twice
Segmentation fault
FAIL: diff of empty file against nonempty one
Segmentation fault
FAIL: diff -b treats EOF as whitespace
Segmentation fault
FAIL: diff -b treats all spaces as equal
Segmentation fault
FAIL: diff -B ignores changes whose lines are all blank
Segmentation fault
FAIL: diff -B does not ignore changes whose lines are not all blank
Segmentation fault
FAIL: diff always takes context from old file
Segmentation fault
FAIL: diff diff1 diff2/subdir
Segmentation fault
FAIL: diff dir dir2/file/-
Segmentation fault
FAIL: diff of dir and fifo
Segmentation fault
FAIL: diff of file and fifo
Segmentation fault
FAIL: diff -rN does not read non-regular files
Failures detected, running with -v (verbose) will give more info

--
vda


More information about the busybox mailing list