From 4bdf8aeb2e907b53cc71c07b3c6be8f82e3f1e4a Mon Sep 17 00:00:00 2001
From: Xu Zheng <xuzheng_yewu@cmss.chinamobile.com>
Date: Thu, 24 Nov 2022 17:58:28 +0800
Subject: [PATCH 20/23] bash-completion: fix variable leaks of "word"

cherry-pick from 097296c30b72f472bcf4e72cf8ab2aeb55903c49

Signed-off-by: Koichi Murase <myoga.murase@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Xu Zheng <xuzheng_yewu@cmss.chinamobile.com>
---
 tools/bash-completion/vsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bash-completion/vsh b/tools/bash-completion/vsh
index 8493cad28b..363097c601 100644
--- a/tools/bash-completion/vsh
+++ b/tools/bash-completion/vsh
@@ -21,7 +21,7 @@ _vsh_complete()
     # See what URI is user trying to connect to and if they are
     # connecting RO. Honour that.
     while [ $c -le $COMP_CWORD ]; do
-        word="${COMP_WORDS[c]}"
+        local word="${COMP_WORDS[c]}"
         case "$word" in
             -r|--readonly) RO=1 ;;
             -c|--connect) c=$((++c)); URI=${COMP_WORDS[c]} ;;
-- 
2.27.0

