From 38480968f0eb252069800b376a1baffcea7ff271 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 31 Jul 2017 15:05:44 +0100 Subject: [PATCH] run_tests.sh: avoid using 'sed -i' as it is non-portable. On FreeBSD 'sed -i' works in a different way than on Linux. --- re2c/run_tests.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/re2c/run_tests.sh.in b/re2c/run_tests.sh.in index d7475fdb..fb2abc8d 100644 --- a/re2c/run_tests.sh.in +++ b/re2c/run_tests.sh.in @@ -171,7 +171,11 @@ run_pack() { # run re2c $valgrind $wine ../../$re2c $switches "$outx" 2>"$outc.stderr" 1>&2 # on windows output contains CR LF, cut CR to match test results - [ -f "$outc" ] && lc_run sed -i 's/\r//g' "$outc" "$outc.stderr" + for f in "$outc" "$outc.stderr"; do + [ -f "$f" ] \ + && cat "$f" | lc_run tr -d '\r' > "$f".mod \ + && mv "$f".mod "$f" + done # paste all files dropped by re2c into output file rm "$outx" && find . -type f \ | lc_run sort \ -- 2.40.0