File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 167167
168168# #############################################################################
169169# For tools/semver-compare.sh ($SEMVER_COMPARE):
170- if [ " ${NUT_VERSION_EXTRA_WIDTH-} " -gt 6 ] 2> /dev/null ; then
170+ if [ -n " ${NUT_VERSION_EXTRA_WIDTH-} " -a " ${NUT_VERSION_EXTRA_WIDTH-} " -gt 6 ] 2> /dev/null ; then
171171 :
172172else
173173 NUT_VERSION_EXTRA_WIDTH=6
180180
181181# When padding extra width for e.g. comparisons, is 1.2.3 equal to 1.2.3.0.0?
182182# Should we add those ".0" in the end?
183- if [ " ${NUT_VERSION_MIN_COMPONENTS-} " -ge 0 ] 2> /dev/null ; then
183+ if [ -n " ${NUT_VERSION_MIN_COMPONENTS-} " -a " ${NUT_VERSION_MIN_COMPONENTS-} " -ge 0 ] 2> /dev/null ; then
184184 # A number specified by caller is valid (positive integer)
185185 :
186186else
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ LC_ALL=C
2828TZ=UTC
2929export LANG LC_ALL TZ
3030
31- if [ " ${NUT_VERSION_EXTRA_WIDTH-} " -gt 6 ] 2> /dev/null ; then
31+ if [ -n " ${NUT_VERSION_EXTRA_WIDTH-} " -a " ${NUT_VERSION_EXTRA_WIDTH-} " -gt 6 ] 2> /dev/null ; then
3232 :
3333else
3434 NUT_VERSION_EXTRA_WIDTH=6
3535fi
3636
37- if [ " ${NUT_VERSION_MIN_COMPONENTS-} " -ge 0 ] 2> /dev/null ; then
37+ if [ -n " ${NUT_VERSION_MIN_COMPONENTS-} " -a " ${NUT_VERSION_MIN_COMPONENTS-} " -ge 0 ] 2> /dev/null ; then
3838 # A number specified by caller is valid (positive integer)
3939 :
4040else
@@ -189,14 +189,14 @@ EOF
189189 exit 0
190190 ;;
191191 --width|-w)
192- if [ " $2 " -ge 6 ]; then
192+ if [ -n " $2 " -a " $2 " -ge 6 ]; then
193193 NUT_VERSION_EXTRA_WIDTH=" $2 "
194194 fi
195195 # FIXME: "else" and error handling vs number too small and ignored?
196196 shift
197197 ;;
198198 --min-components)
199- if [ " $2 " -ge 0 ]; then
199+ if [ -n " $2 " -a " $2 " -ge 0 ]; then
200200 NUT_VERSION_MIN_COMPONENTS=" $2 "
201201 fi
202202 # FIXME: "else" and error handling vs number too small and ignored?
You can’t perform that action at this time.
0 commit comments