tests: init.sh: work also with any non-GNU diff that supports -u
authorBruno Haible <bruno@clisp.org>
Fri, 2 Sep 2011 12:13:59 +0000 (14:13 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 2 Sep 2011 13:17:09 +0000 (15:17 +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,
AIX 7.1, IRIX 6.5 and Solaris 10.

ChangeLog
tests/init.sh

index 5f8369e..1c292ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-02  Bruno Haible  <bruno@clisp.org>
+
+       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,
+       AIX 7.1, IRIX 6.5 and Solaris 10.
+
 2011-09-01  Bruno Haible  <bruno@clisp.org>
 
        strtoimax, strtoumax: Document problem on HP-UX 11.
index 0da6c1e..d3fb28c 100644 (file)
@@ -208,7 +208,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 "$@"; }