summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-04-18 13:22:26 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-18 13:22:26 +0200
commitd9136efd7ac5f7655376057e0ba28498a975216b (patch)
tree43f285b082353f2224c1054570a54a3d39fbca77 /scripts
parentb65e7f629ef3cd655eb9a2a6f47530e5fd098ae3 (diff)
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gcc-version.sh2
1 files changed, 1 insertions, 1 deletions
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