Skip to content
Commit 1e198d76 authored by Sibo Dong's avatar Sibo Dong Committed by Zbigniew Jędrzejewski-Szmek
Browse files

bash-completion: localize words and cword variables

The words and cword variables are not localized in all Bash completion
scripts that call _init_completion.

cur, prev, words, and cword (and split if using the -s flag) are all
variables that should be localized in Bash completion scripts before
calling _init_completion (even if they don't otherwise appear in the
calling script). This is done for cur and prev, but not for words and
cword. Letting words and cword remain unlocalized may clobber variables
the user is using for other purposes, which is bad.

This issue can be resolved by declaring words and cword as local
variables.

Resolves #19188.

(cherry picked from commit f34173a0)
(cherry picked from commit 90aee910)
(cherry picked from commit d62208c2)
parent 2e2459e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment