Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Michal Prívozník
On 11/23/21 13:50, Koichi Murase wrote:
> Thank you for reviewing the patch.
> 
> 2021年11月23日(火) 21:37 Michal Prívozník :
>> [...]
>>
>> The word variable is also used only inside a while loop (not visible in
>> the context). So it can be declared local there instead of here. I'll
>> fix that before pushing.
> 
> OK.
> 
>> However, we do require developers to provide signoff for their patches
>> to signal their compliance with DCO:
>>
>> https://libvirt.org/hacking.html#developer-certificate-of-origin
>>
>> No need to resend the whole patch, it's sufficient if you reply with
>> your SoB line.
> 
> OK. Are just the following lines sufficient?
> --
> [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"
> 
> Signed-off-by: Koichi Murase 

Perfect.

Reviewed-by: Michal Privoznik 

and pushed. Congratulations on your first libvirt contribution!

Michal



Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Koichi Murase
Thank you for reviewing the patch.

2021年11月23日(火) 21:37 Michal Prívozník :
> [...]
>
> The word variable is also used only inside a while loop (not visible in
> the context). So it can be declared local there instead of here. I'll
> fix that before pushing.

OK.

> However, we do require developers to provide signoff for their patches
> to signal their compliance with DCO:
>
> https://libvirt.org/hacking.html#developer-certificate-of-origin
>
> No need to resend the whole patch, it's sufficient if you reply with
> your SoB line.

OK. Are just the following lines sufficient?
--
[PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

Signed-off-by: Koichi Murase 

--
Thank you,
Koichi




Re: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-23 Thread Michal Prívozník
On 11/14/21 07:06, Koichi Murase wrote:
> ---
>  tools/bash-completion/vsh.in | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in
> index 70ade50a02..4399ff0a64 100644
> --- a/tools/bash-completion/vsh.in
> +++ b/tools/bash-completion/vsh.in
> @@ -4,7 +4,7 @@
>  
>  _@command@_complete()
>  {
> -local words cword c=0 i=0 cur RO URI CMDLINE INPUT A
> +local words cword c=0 i=0 cur word RO URI CMDLINE INPUT A

The word variable is also used only inside a while loop (not visible in
the context). So it can be declared local there instead of here. I'll
fix that before pushing.

However, we do require developers to provide signoff for their patches
to signal their compliance with DCO:

https://libvirt.org/hacking.html#developer-certificate-of-origin

No need to resend the whole patch, it's sufficient if you reply with
your SoB line.

Michal



[PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word"

2021-11-15 Thread Koichi Murase
---
 tools/bash-completion/vsh.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in
index 70ade50a02..4399ff0a64 100644
--- a/tools/bash-completion/vsh.in
+++ b/tools/bash-completion/vsh.in
@@ -4,7 +4,7 @@
 
 _@command@_complete()
 {
-local words cword c=0 i=0 cur RO URI CMDLINE INPUT A
+local words cword c=0 i=0 cur word RO URI CMDLINE INPUT A
 
 # Here, $COMP_WORDS is an array of words on the bash
 # command line that user wants to complete. However, when
@@ -56,7 +56,8 @@ _@command@_complete()
 # the name of the command whose arguments are being
 # completed.
 # Therefore, we might just run $1.
-IFS=$'\n' A=($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/null))
+local IFS=$'\n'
+A=($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/null))
 
 COMPREPLY=($(compgen -W "${A[*]%--}" -- ${cur}))
 __ltrim_colon_completions "$cur"
-- 
2.21.3