grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] bash-completion:fix shellcheck error


From: Daniel Kiper
Subject: Re: [PATCH 1/2] bash-completion:fix shellcheck error
Date: Wed, 23 Nov 2022 16:57:10 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Sep 19, 2022 at 09:20:13AM +0800, t.feng via Grub-devel wrote:
> SC2070 (error): -n doesn't work with unquoted arguments.
> Quote or use [[ ]].
> In grub-completion.bash.in line 130:
>              [ -n $tmp ] && {
>                   ^--^ SC2070 (error)
>
> ref:https://github.com/koalaman/shellcheck/wiki/SC2070

Missing SOB. Otherwise LGTM...

> ---
>  util/bash-completion.d/grub-completion.bash.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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}
>               }

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]