From 9b3899a94d9b09f3dd6cc1cef8b335d10c569b1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Wed, 25 Nov 2015 14:26:59 +0000 Subject: [PATCH] tests: for compare_(), use cmp -s where available * tests/init.sh (compare_): Only fall back to cmp without the POSIX defined -s option, where this is not available. --- ChangeLog | 6 ++++++ tests/init.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9aa8bb5827..c41b27dc8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-01-01 Pádraig Brady + + tests: for compare_(), use cmp -s where available + * tests/init.sh (compare_): Only fall back to cmp without + the POSIX defined -s option, where this is not available. + 2016-01-01 Paul Eggert version-etc: new year diff --git a/tests/init.sh b/tests/init.sh index 67466bfb2f..ee0802241f 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -327,7 +327,7 @@ elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then fi } fi -elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then +elif cmp -s /dev/null /dev/null 2>/dev/null; then compare_ () { cmp -s "$@"; } else compare_ () { cmp "$@"; } -- 2.39.5