mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-15 00:38:15 +00:00
conftools/get-version.sh: Fix unsafe expansions of $hdr
Also, use $() instead of ``. See http://mywiki.wooledge.org/BashFAQ/082.
This commit is contained in:
parent
9502963fd2
commit
c14a173105
1 changed files with 3 additions and 3 deletions
|
@ -28,8 +28,8 @@ if test ! -r "$hdr"; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
MAJOR_VERSION="`sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' $hdr`"
|
||||
MINOR_VERSION="`sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' $hdr`"
|
||||
MICRO_VERSION="`sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' $hdr`"
|
||||
MAJOR_VERSION=$(sed -n -e '/MAJOR_VERSION/s/[^0-9]*//gp' "$hdr")
|
||||
MINOR_VERSION=$(sed -n -e '/MINOR_VERSION/s/[^0-9]*//gp' "$hdr")
|
||||
MICRO_VERSION=$(sed -n -e '/MICRO_VERSION/s/[^0-9]*//gp' "$hdr")
|
||||
|
||||
printf '%s.%s.%s' "$MAJOR_VERSION" "$MINOR_VERSION" "$MICRO_VERSION"
|
||||
|
|
Loading…
Add table
Reference in a new issue