gcc-version.sh: Cygwin fix

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

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-04-18 13:22:26 +02:00
parent b65e7f629e
commit d9136efd7a

View File

@ -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