[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1d74adc296c7f5d744c29481536cbd8948768ae5

Ville Skyttä ville.skytta at iki.fi
Thu Oct 29 17:16:03 UTC 2009


The following commit has been merged in the master branch:
commit 1d74adc296c7f5d744c29481536cbd8948768ae5
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu Oct 29 19:15:53 2009 +0200

    Fix sed error in qdbus completions containing slashes (Debian: 552631).

diff --git a/CHANGES b/CHANGES
index 116ffd4..d01f378 100644
--- a/CHANGES
+++ b/CHANGES
@@ -26,6 +26,7 @@ bash-completion (2.x)
     Marco Poletti (Alioth: #312021).
   * Improve sourcing snippets from completion dirs.
   * Drop support for bash < 3.
+  * Fix sed error in qdbus completions containing slashes (Debian: 552631).
 
  -- David Paleino <d.paleino at gmail.com>  Sun, 11 Oct 2009 11:11:57 +0200
 
diff --git a/contrib/qdbus b/contrib/qdbus
index 1e70c70..ed5002d 100644
--- a/contrib/qdbus
+++ b/contrib/qdbus
@@ -7,13 +7,9 @@ _qdbus()
 
     COMPREPLY=()
     cur=`_get_cword`
-    if [ -z "$cur" ]; then
-        compstr=${COMP_WORDS[*]}
-    else
-        compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ ${cur/\//\\/}$//" )
-    fi
-        COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \
-            -- "$cur" ) )
+    [ -n "$cur" ] && unset COMP_WORDS[${#COMP_WORDS[@]}-1]
+    COMPREPLY=( $( compgen -W '$( command ${COMP_WORDS[@]} | sed s/\(.*\)// )' \
+        -- "$cur" ) )
 } &&
 complete -F _qdbus qdbus
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list