summaryrefslogtreecommitdiff
path: root/scripts/binutils-version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/binutils-version.sh')
-rwxr-xr-xscripts/binutils-version.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh
index 0bc26cf..a343681 100755
--- a/scripts/binutils-version.sh
+++ b/scripts/binutils-version.sh
@@ -14,7 +14,8 @@ if [ ${#gas} -eq 0 ]; then
exit 1
fi
-version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
+version_string=$($gas --version | head -1 | \
+ sed -e 's/(.*)//; s/[^0-9.]*\([0-9.]*\).*/\1/')
MAJOR=$(echo $version_string | cut -d . -f 1)
MINOR=$(echo $version_string | cut -d . -f 2)