Source: boo
Version: 0.9.5~git20110729.r1.202a430-2
Severity: wishlist
Justification: unpackaged, bug present in source package
Tags: upstream patch

Hi,

boo's bash completion script overwrites COMP_WORDBREAKS globally,
affecting other completion scripts, instead of pasting words
together locally using the _get_comp_words_by_ref function
(see that function's documentation in /etc/bash_completion for
details).  Here's a ("git am --scissors"-ready) patch to fix that.

Thanks and hope that helps,
Jonathan

-- >8 --
Subject: bash completion: do not overwrite global COMP_WORDBREAKS variable

Override its value locally using the "-n" option to the
_get_comp_words_by_ref helper instead.  This should ensure that other
completion scripts are not affected by the change to the list of
word-breaking characters.
---
 extras/boo-completion.bash | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/extras/boo-completion.bash b/extras/boo-completion.bash
index cb367d1c..bdfb3dc6 100755
--- a/extras/boo-completion.bash
+++ b/extras/boo-completion.bash
@@ -6,9 +6,8 @@ _booc()
 {
        local cur
 
-       COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
        COMPREPLY=()
-       cur=${COMP_WORDS[COMP_CWORD]}
+       _get_comp_words_by_ref -n : cur
 
        if [[ "$cur" == -* ]]; then
                COMPREPLY=( $( compgen -W '-help -v -vv -vvv \
@@ -28,9 +27,8 @@ _booi()
 {
        local cur
 
-       COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
        COMPREPLY=()
-       cur=${COMP_WORDS[COMP_CWORD]}
+       _get_comp_words_by_ref -n : cur
 
        if [[ "$cur" == -* ]]; then
                COMPREPLY=( $( compgen -W '\
@@ -49,9 +47,8 @@ _booish()
 {
        local cur
 
-       COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
        COMPREPLY=()
-       cur=${COMP_WORDS[COMP_CWORD]}
+       _get_comp_words_by_ref -n : cur
 
        if [[ "$cur" == -* ]]; then
                COMPREPLY=( $( compgen -W '\
-- 
1.8.3


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to