]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: init.sh: work also with any non-GNU diff that supports -u
authorBruno Haible <bruno@clisp.org>
Fri, 2 Sep 2011 08:51:52 +0000 (10:51 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 2 Sep 2011 12:08:40 +0000 (14:08 +0200)
* 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.

tests/init.sh

index 460937de4f9d2c7164c0990d11b94e808c32509b..12b3ca37e1292f8b27fde5ffe897a5348e823d30 100644 (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 "$@"; }