From 3effdc15053a53acc36c421ee8df78cf78879fa9 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 7 Apr 2023 19:32:22 +0200 Subject: [PATCH] Protect CROSS_PATH against spurious addition of linebreaks from isolated dashes fix for #3989 --- c_check | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/c_check b/c_check index e8f90e18a0..7173968e5c 100755 --- a/c_check +++ b/c_check @@ -35,9 +35,12 @@ if [ "`dirname \"$compiler_name\"`" != '.' ]; then cross_suffix="$cross_suffix`dirname \"$compiler_name\"`/" fi -bn=`basename $compiler_name` +bn=`basename \"$compiler_name\"` + case "$bn" in - *-*) cross_suffix="$cross_suffix${bn%-*}-" + *-*) if [ "$bn" != '-']; then + cross_suffix="$cross_suffix${bn%-*}-" + fi esac compiler=""