From: t.feng Date: Tue, 6 Dec 2022 13:49:28 +0000 (+0800) Subject: util/bash-completion: Fix SC2070 shellcheck error X-Git-Tag: grub-2.12-rc1~192 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2029c4822b64ab0365340e35387bbcbd311b94b4;p=thirdparty%2Fgrub.git 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 Reviewed-by: Daniel Kiper --- diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in index 44bf135b9..93d143480 100644 --- a/util/bash-completion.d/grub-completion.bash.in +++ b/util/bash-completion.d/grub-completion.bash.in @@ -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} }