Jim Meyering wrote: > FYI, I've just pushed this in Bruno's name: I see it pushed in coreutils, not in gnulib.
> Rather than checking for GNU diff via --version, simply check > for support for -u itself. Useful at least on OpenBSD 4.9. Also useful on AIX 7.1, IRIX 6.5, Solaris 10. And on AIX 6.1, HP-UX 11.31, OSF/1 5.1, Solaris 8, "diff -u" is not supported, but "diff -c" is. (As specified by POSIX:2001.) Therefore I would go one step further: 2011-09-02 Bruno Haible <[email protected]> * tests/init.sh (compare): If "diff -c" is supported but "diff -u" is not, use "diff -c". --- tests/init.sh.orig Fri Sep 2 14:55:47 2011 +++ tests/init.sh Fri Sep 2 14:55:26 2011 @@ -223,6 +223,8 @@ if ( diff -u "$0" "$0" < /dev/null ) > /dev/null 2>&1; then compare () { diff -u "$@"; } +elif ( diff -c "$0" "$0" < /dev/null ) > /dev/null 2>&1; then + compare () { diff -c "$@"; } elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then compare () { cmp -s "$@"; } else -- In memoriam Robert Mensah <http://en.wikipedia.org/wiki/Robert_Mensah>
