tests: init.sh: work also with any non-GNU diff that supports -u
[gnulib.git] / tests / init.sh
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 "$@"; }