Add the BSD-licensed diff from OpenBSD, which is optionally built and
installed when WITHOUT_GNU_DIFF is set.
r315051:
Import diff from OpenBSD
Some of the modifications from the previous summer of code has been integrated
Modification for compatibility with GNU diff output has been added
Main difference with OpenBSD:
Implement multiple GNU diff options:
* --ignore-file-name-case
* --no-ignore-file-name-case
* --normal
* --tabsize
* --strip-trailing-cr
Make diff -p compatible with GNU diff
Implement diff -l
Make diff -r compatible with GNU diff
Capsicumize diffing 2 regular files
Add a simple test suite
r315103:
Implement a stub --horizon-lines=NUM for compatibility with GNU diff3
some options of GNU diff3 would call diff with --horizon-lines, rcs is depending
on that.
Reported by: antoine
r315107:
Fix building with recent gcc
Reported by: lwhsu, ngie
r315180:
Readd codes that creates a tmp file for diffing stdout or devices
r315197:
Do not die if cap_rights_limit reports ENOSYS
Reported by: mmel
r315293:
Integrate contrib/netbsd-tests/usr.bin/diff/t_diff.sh in as
.../usr.bin/diff/diff_test
Some minor adjustment needed to be done for :same as it currently
has the test script hardcoded into the test, instead of using an
idiom like $(dirname $0)
Sponsored by: Dell EMC Isilon
r315319:
diff(1): sort long options under -D example in SYNOPSYS
Sponsored by: Dell EMC Isilon
r315590:
diff(1): add --strip-trailing-cr to last example in the SYNOPSIS
This syncs the last example in the SYNOPSIS with the other examples.
r316639:
add a stub --speed-large-files for compatibility with GNU diff
There is no intention to implement it, but lots of scripts/tools using
diff(1) passes GNU diff option
r316959:
Clean up headers declaration
r317187:
Add a regression test for diff -D
r317194:
Implement a basic --changed-group-format
etcupdate(8) requires that option, while GNU diff supports many more variation
of that options, their behaviour beside the simple verion implemented here are
quite inconsistent as such I do not plan to implement those.
The only special keyword supported by this implementation are: %< and %>
%= is not implemented as the documentation of GNU diff says: common lines, but
it actually when tested print the changes from the first file
r317205:
Document all long options
r317206:
Update the TODO list to reflect what has been changed
r317207:
Cross reference pr(1) which diff might call with -l option
r317381:
Fix the following warning from gcc 4.2 in usr.bin/diff:
usr.bin/diff/diffreg.c: In function 'change':
usr.bin/diff/diffreg.c:1085: warning: 'i' may be used uninitialized in this function
This version of gcc is not smart enough to see that 'i' cannot actually
be used unitialized. However, the variable is confusingly re-used, so
it is better to give it another name, and clearly initialize it before
attempting to use it.
r319847:
Add some testcases for `diff --side-by-side` support
These are were created proactively, in anticipation of the support being
fully implemented sometime in the future.
The tests currently fail on ^/head@r319845, however. Expect them to fail.
PR: 219933
Tested with: gdiff
r321076:
Don't emit "diff: diff <options> arguments" when diffing files if
-q is specified.
This improves compatibility with GNU diff.
Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`.
Relnotes: yes
r321077:
Add some tests for brief (--brief/-q) format
MFC with: r321076
r321078:
Fix exit status with -rq when there is a file in one directory but not another,
i.e., when print_only is called.
Prior to this change, -rq was always returning 0. After this change it will
return 1 if there is a difference between two directories.
This fixes compatibility with GNU diff and unbreaks backwards compatibility
expectations.
Found when trying to extend diff_test:brief_format_test.
MFC with: r321076, r321077
r321079:
Add tests that exercise -q, like -rq and add tests that test -q like -Nrq
MFC with: r321076, r321077, r321078
r321227:
Use more flexible expression for replacing t_diff in
contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
`basename $0`.
This was a change I forgot to port over from
^/head/gnu/usr.bin/diff/tests/Makefile@r272787.
r326822:
Replace homemade equivalent of tolower(3) by towlower(3)
This will help in the futur making diff -i works with multibyte