tests: fix potentially unbound variable in kernel_version_code
Fix the following use case: $ sh -uc '. tests/init.sh; kernel_version_code 4.5' tests/init.sh: line 242: 3: unbound variable * tests/init.sh (kernel_version_code): Fix potentially unbound variable.
This commit is contained in:
parent
5c0896d9d8
commit
73edd445e2
@ -236,7 +236,7 @@ kernel_version_code()
|
||||
(
|
||||
set -f
|
||||
IFS=.
|
||||
set -- $1
|
||||
set -- $1 0 0
|
||||
v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0
|
||||
v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0
|
||||
v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0
|
||||
|
Loading…
x
Reference in New Issue
Block a user