From 03bdc34001937331278f668e9ecf14154a336094 Mon Sep 17 00:00:00 2001 From: Chris King-Parra Date: Wed, 28 Feb 2018 11:27:40 -0500 Subject: [PATCH] Quote expansions in firmware_size() of bin/kaleidoscope-builder. I left line 35 (the "output" variable) alone. Issue #299. --- bin/kaleidoscope-builder | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 91cfd67a..839a577d 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -24,8 +24,8 @@ build_filenames () { firmware_size () { if [ "${BOARD}" = "virtual" ]; then - echo "[Size not computed for virtual build]" - return + echo "[Size not computed for virtual build]" + return fi ## This is a terrible hack, please don't hurt me. - algernon @@ -34,9 +34,9 @@ firmware_size () { output="$($@ | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)" - PROGSIZE="$(echo "${output}" | grep Program: | cut -d: -f2 | awk '{print $1}')" + PROGSIZE="$(echo "${output}" | grep "Program:" | cut -d: -f2 | awk '{print $1}')" - PERCENT="$(echo ${PROGSIZE} ${MAX_PROG_SIZE} | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")" + PERCENT="$(echo "${PROGSIZE}" "${MAX_PROG_SIZE}" | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")" echo "${output}" | sed -e "s/\(Program:.*\)(\([0-9\.]*%\) Full)/\1(${PERCENT}% Full)/" }