util/bash-completion: Fix SC2070 shellcheck error
SC2070 (error): -n doesn't work with unquoted arguments.
Quote or use [[ ]].
In grub-completion.bash.in line 130:
[ -n $tmp ] && {
^--^ SC2070 (error)
More: https://github.com/koalaman/shellcheck/wiki/SC2070
Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
e375394fb9
commit
2029c4822b
@ -127,7 +127,7 @@ __grub_list_modules () {
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -f -X '!*/*.mod' -- "${grub_dir}/$cur" | {
|
||||
while read -r tmp; do
|
||||
[ -n $tmp ] && {
|
||||
[ -n "$tmp" ] && {
|
||||
tmp=${tmp##*/}
|
||||
printf '%s\n' ${tmp%.mod}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user