[git commit] gcc-version.sh: Cygwin fix

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 18 11:22:26 UTC 2021


commit: https://git.busybox.net/busybox/commit/?id=d9136efd7ac5f7655376057e0ba28498a975216b
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

On Cygwin, "echo __GNUC__ __GNUC_MINOR__ | gcc -E -xc -" can print
extra empty trailing line.

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 scripts/gcc-version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index 34510804f..9376ed4fb 100755
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
@@ -8,5 +8,5 @@
 
 compiler="$*"
 
-MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
+MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | grep . | tail -n 1)
 printf '%02d%02d\n' $MAJ_MIN


More information about the busybox-cvs mailing list