tools/make-version-header.sh: fix minor version extraction

bash considers sequences of integers starting with zero to be octal, so e.g. a
$minor value of "08" will be taken as an (illegal) octal number, causing an
error.

To fix this, we drop any leading zero when extracting the minor version.
master
Nicolás Ojeda Bär 2018-04-11 10:07:34 +02:00
parent 6dddb9d854
commit 5f38a63b2a
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ case $# in
esac
major="`echo "$version" | sed -n -e '1s/^\([0-9]*\)\..*/\1/p'`"
minor="`echo "$version" | sed -n -e '1s/^[0-9]*\.\([0-9]*\).*/\1/p'`"
minor="`echo "$version" | sed -n -e '1s/^[0-9]*\.0*\([0-9]*\).*/\1/p'`"
patchlvl="`echo "$version" | sed -n -e '1s/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p'`"
suffix="`echo "$version" | sed -n -e '1s/^[^+]*+\(.*\)/\1/p'`"