Skip to content

Commit

Permalink
juis_check: values with preceding zeros were interpreted as octal num…
Browse files Browse the repository at this point in the history
…bers
  • Loading branch information
PeterPawn committed Nov 19, 2018
1 parent d95da61 commit eaa8e3b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions juis/juis_check
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ version_decrement="Patch Minor"
version_decrement_clear="$buildnumber_name=00000"
boxinfo1_replace_names=""
boxinfo2_replace_names="Revision:Buildnumber"
numeric_values="Major Minor Patch"
alt_names="$version_name:Major $version_name:Minor $version_name:Patch $version_name:$buildnumber_name"
# flag option name, may contain more than one value (delimited by comma), will be splitted to multiple XML entities
flags_name="Flag"
Expand Down Expand Up @@ -1112,6 +1113,16 @@ replace_in_file()
)
#######################################################################################################
# #
# convert values with preceding zeros to their decimal value, any leading zero would switch the #
# meaning of following number to 'octal digit' #
# #
#######################################################################################################
get_decimal_value()
(
expr "$1" : "0*\([0-9]\+\)"
)
#######################################################################################################
# #
# split old style version number into parts with the new names #
# #
#######################################################################################################
Expand Down Expand Up @@ -1423,6 +1434,15 @@ for f in $Flag; do
done
#######################################################################################################
# #
# convert values to surely decimal content #
# #
#######################################################################################################
for n in $numeric_values; do
eval v=\$$n
eval $n=$(get_decimal_value $v)
done
#######################################################################################################
# #
# decrement version number to get an answer with an URL in every case #
# #
#######################################################################################################
Expand Down

0 comments on commit eaa8e3b

Please sign in to comment.