mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
test/test_compression.sh : Fix for OSX.
On Mac OSX, the 'wc -c' command returns a number with leading whitespace which then results in a syntax error when the shell parser expects a number when it really has a string containing a number. The easy fix is to use string interpolation. Closes: https://sourceforge.net/p/flac/bugs/420/ Reported-by: Mark Harris <mark.hsj@gmail.com>
This commit is contained in:
@@ -36,10 +36,12 @@ for k in 0 1 2 3 4 5 6 7 8 ; do
|
||||
size=$(wc -c < ${fname})
|
||||
echo "Compression level ${k}, file size ${size} bytes."
|
||||
if test ${last_size} -lt ${size} ; then
|
||||
echo "Error : Compression ${last_k} size $last_size >= compression $k size $size."
|
||||
echo "Error : Compression ${last_k} size ${last_size} >= compression ${k} size ${size}."
|
||||
exit 1
|
||||
fi
|
||||
let last_size=${size}+10
|
||||
# Need this string interpolation because OSX's 'wc -c' returns a number with
|
||||
# leading whitespace.
|
||||
let last_size="${size}+10"
|
||||
last_k=${k}
|
||||
rm -f ${fname}
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user