From 795ed1eb495a75b4e1bb516b592c06c020fe05de Mon Sep 17 00:00:00 2001 From: David Legrand <1110600+davlgd@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:01:31 +0100 Subject: [PATCH] Fix functional-tests.sh file generation under macOS (#4875) Fixes #4874 `head -c 0` leads to an `head: illegal byte count -- 0` error under macOS. We should also provide the input with `-i` parameter (it's ok under GNU/Linux too) --- functional-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functional-tests.sh b/functional-tests.sh index b6961f6e..f655c153 100755 --- a/functional-tests.sh +++ b/functional-tests.sh @@ -1149,15 +1149,15 @@ function __init__() MC_CMD=( "${MC}" --config-dir "$MC_CONFIG_DIR" --quiet --no-color ) if [ ! -e "$FILE_0_B" ]; then - base64 /dev/urandom | head -c 0 >"$FILE_0_B" + touch "$FILE_0_B" fi if [ ! -e "$FILE_1_MB" ]; then - base64 /dev/urandom | head -c 1048576 >"$FILE_1_MB" + base64 -i /dev/urandom | head -c 1048576 >"$FILE_1_MB" fi if [ ! -e "$FILE_65_MB" ]; then - base64 /dev/urandom | head -c 68157440 >"$FILE_65_MB" + base64 -i /dev/urandom | head -c 68157440 >"$FILE_65_MB" fi set -E