shell-completion: bash: Localize word variable

The word variables used in the _pactl and _pacmd functions are
unlocalized. Thus, the variable appears in the user's environment when
tab-completing with pactl or pacmd. This may clobber another variable
of the same name, which is undesirable.

Localize the word variable to fix this issue.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/623>
This commit is contained in:
Sibo Dong 2021-08-18 16:51:55 +00:00 committed by PulseAudio Marge Bot
parent 2c7c0f0912
commit 53e3b53408

View file

@ -109,7 +109,7 @@ in_array() {
}
_pactl() {
local cur prev words cword preprev command
local cur prev words cword preprev word command
local comps
local flags='-h --help --version -s --server= --client-name='
local list_types='short sinks sources sink-inputs source-outputs cards
@ -255,7 +255,7 @@ _pactl() {
complete -F _pactl pactl
_pacmd() {
local cur prev words cword preprev command
local cur prev words cword preprev word command
local comps
local flags='-h --help --version'
local commands=(exit help list-modules list-cards list-sinks list-sources list-clients