From d3d8de3a5ab5f002dca86c624f7d8b132cf1eb9a Mon Sep 17 00:00:00 2001 From: Thomas Beutlich Date: Tue, 13 Aug 2024 18:53:17 +0200 Subject: [PATCH] Check if diff supports the --strip-trailing-cr option --- contrib/tests/shpproj.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/tests/shpproj.sh b/contrib/tests/shpproj.sh index 229b269..9eefa0d 100755 --- a/contrib/tests/shpproj.sh +++ b/contrib/tests/shpproj.sh @@ -21,12 +21,12 @@ readonly SCRIPTDIR=$(dirname "$0") "${SHPDUMP:-$top_builddir/shpdump}" -precision 8 "test" > "test.out" -is_windows() { - [ -n "$WINDIR" ] || uname | grep -q "MINGW" +supports_strip_trailing_cr() { + diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr' } run_diff() { - if is_windows; then + if supports_strip_trailing_cr; then diff --strip-trailing-cr "$SCRIPTDIR/expect.out" "test.out" else diff "$SCRIPTDIR/expect.out" "test.out"