diff options
author | Joel Holdsworth <jholdsworth@nvidia.com> | 2022-02-24 16:30:14 +0000 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2022-05-11 20:25:42 +1200 |
commit | d10a4318ace8f0e668e23b919195d63a9478171c (patch) | |
tree | b7471c824dc304e83667a6198d70f8e6d9a78274 /scripts | |
parent | d8249832033d63756c902b50594084df58d73c65 (diff) | |
download | crosstool-ng-d10a4318ace8f0e668e23b919195d63a9478171c.tar.gz crosstool-ng-d10a4318ace8f0e668e23b919195d63a9478171c.tar.bz2 crosstool-ng-d10a4318ace8f0e668e23b919195d63a9478171c.zip |
cc/gcc: Ensure value of ext is always set
The "ext" variable is set with the file extension of executable binaries
for a given platform. To improve tidiness, this patch ensures the
variable is always set even when there is no file path.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/cc/gcc.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 7002ddd8..2b7779a6 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -707,7 +707,7 @@ do_gcc_core_backend() { # to call the C compiler with the same, somewhat canonical name. # check whether compiler has an extension file="$( ls -1 "${prefix}/bin/${CT_TARGET}-${CT_CC}."* 2>/dev/null || true )" - [ -z "${file}" ] || ext=".${file##*.}" + [ -z "${file}" ] && ext="" || ext=".${file##*.}" if [ -f "${prefix}/bin/${CT_TARGET}-${CT_CC}${ext}" ]; then CT_DoExecLog ALL ln -sfv "${CT_TARGET}-${CT_CC}${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}" fi @@ -1258,7 +1258,7 @@ do_gcc_backend() { # to call the C compiler with the same, somewhat canonical name. # check whether compiler has an extension file="$( ls -1 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${CT_CC}."* 2>/dev/null || true )" - [ -z "${file}" ] || ext=".${file##*.}" + [ -z "${file}" ] && ext="" || ext=".${file##*.}" if [ -f "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${CT_CC}${ext}" ]; then CT_DoExecLog ALL ln -sfv "${CT_TARGET}-${CT_CC}${ext}" "${prefix}/bin/${CT_TARGET}-cc${ext}" fi |