Skip to content

Commit 73edd44

Browse files
committed
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.
1 parent 5c0896d commit 73edd44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ kernel_version_code()
236236
(
237237
set -f
238238
IFS=.
239-
set -- $1
239+
set -- $1 0 0
240240
v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0
241241
v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0
242242
v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0

0 commit comments

Comments
 (0)