]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Fix sporadic test.profiling failures (#1056)
authorjacobly0 <jacobly0@users.noreply.github.com>
Sun, 1 May 2022 16:10:56 +0000 (18:10 +0200)
committerGitHub <noreply@github.com>
Sun, 1 May 2022 16:10:56 +0000 (18:10 +0200)
Using cut, which is always line-based, to remove bytes from a binary file can
cause problems if the binary timestamp field happens to contain a newline
character, which causes test.profiling to fail <1% of the time. Instead use tail
which has a character mode that ignores newlines.

test/suites/profiling.bash

index d2bb2be876619d9021ed3fae4a2faafed019f200..f9043b1a555773e5e98307f1b1039d0d2142f299 100644 (file)
@@ -2,7 +2,7 @@
 normalize_gcno_file() {
     local from="$1"
     local to="$2"
-    cut -b 13- "${from}" >"${to}"
+    tail -c +13 "${from}" >"${to}"
 }