tests: init.sh: work also with any non-GNU diff that supports -u

* tests/init.sh: Relax check for diff -u support.
Rather than checking for GNU diff via --version, simply check
for support for -u itself.  Useful at least on OpenBSD 4.9.
This commit is contained in:
Bruno Haible authored and Jim Meyering committed 2011-09-02 14:08:40 +02:00
1 parent 7490145dd0
commit 0cefe58092
1 file changed
+1 -1
+1 -1
View File
@@ -221,7 +221,7 @@ export MALLOC_PERTURB_
# a partition, or to undo any other global state changes.
cleanup_ () { :; }
if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
if ( diff -u "$0" "$0" < /dev/null ) > /dev/null 2>&1; then
compare () { diff -u "$@"; }
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
compare () { cmp -s "$@"; }