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

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

 



---
 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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux