Skip to content

Commit

Permalink
Check if diff supports the --strip-trailing-cr option
Browse files Browse the repository at this point in the history
  • Loading branch information
thbeu committed Aug 13, 2024
1 parent f512a23 commit d3d8de3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/tests/shpproj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d3d8de3

Please sign in to comment.