diff -u bash-completion-20060301/debian/control bash-completion-20060301/debian/control --- bash-completion-20060301/debian/control +++ bash-completion-20060301/debian/control @@ -1,7 +1,8 @@ Source: bash-completion Section: shells Priority: optional -Maintainer: Luk Claes +XSBC-Original-Maintainer: Luk Claes +Maintainer: Ubuntu MOTU Developers Build-Depends: debhelper (>= 5) Standards-Version: 3.7.3 diff -u bash-completion-20060301/debian/changelog bash-completion-20060301/debian/changelog --- bash-completion-20060301/debian/changelog +++ bash-completion-20060301/debian/changelog @@ -1,3 +1,15 @@ +bash-completion (20060301-3ubuntu1) hardy; urgency=low + + * Bug fix upload (LP: #194860) + - Fixed completion of filenames with spaces + - Fixed completion of hostnames with scp + - Fixed completion of filenames with scp + - Fixed parsing of SSH config files to parse Host and HostName lines + correctly. Previously "HostName host" lines were parsed as two hosts: + "Name" and "host". + + -- Mika Fischer Sat, 15 Mar 2008 14:33:23 +0100 + bash-completion (20060301-3) unstable; urgency=low * Fix kpdf completion (Closes: #468163, #413374). diff -u bash-completion-20060301/bash_completion bash-completion-20060301/bash_completion --- bash-completion-20060301/bash_completion +++ bash-completion-20060301/bash_completion @@ -183,14 +183,34 @@ # (For example, if the line is "ls foobar", # and the cursor is here --------> ^ # it will complete just "foo", not "foobar", which is what the user wants.) +# +# Accepts an optional parameter indicating which characters out of +# $COMP_WORDBREAKS should NOT be considered word breaks. This is useful +# for things like scp where we want to return host:path and not only path. _get_cword() { - local word_start + local i + local WORDBREAKS=${COMP_WORDBREAKS} + if [ -n $1 ]; then + for (( i=0; i<${#1}; ++i )); do + local char=${1:$i:1} + WORDBREAKS=${WORDBREAKS//$char/} + done + fi + local cur=${COMP_LINE:0:$COMP_POINT} + local tmp="${cur}" + local word_start=`expr "$tmp" : '.*['"${WORDBREAKS}"']'` + while [ "$word_start" -ge 2 ]; do + local char=${cur:$(( $word_start - 2 )):1} + if [ "$char" != "\\" ]; then + break + fi + tmp=${COMP_LINE:0:$(( $word_start - 2 ))} + word_start=`expr "$tmp" : '.*['"${WORDBREAKS}"']'` + done - cur=${COMP_LINE:0:$COMP_POINT} - word_start=`expr "$cur" : '.*['"${COMP_WORDBREAKS}"']'` - cur=${cur:$word_start} - echo $cur + cur=${cur:$word_start} + echo $cur } @@ -2527,9 +2547,10 @@ fi done fi + # append any available aliases from config files if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then - local host_aliases=$( sed -ne 's/^[Hh][Oo][Ss][Tt]['"$'\t '"']*\([^*?]*\)$/\1/p' "${config[@]}" ) + local host_aliases=$( sed -ne 's/^[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^*?]*\)$/\2/p' "${config[@]}" ) hosts=$( compgen -W "$host_aliases" -- $ocur ) COMPREPLY=( ${COMPREPLY[@]} $hosts ) fi @@ -2588,13 +2609,13 @@ { local cur userhost path - local IFS=$'\t\n' COMPREPLY=() - cur=`_get_cword` + cur=`_get_cword ":"` _expand || return 0 if [[ "$cur" == *:* ]]; then + local IFS=$'\t\n' # remove backslash escape from : cur=${cur/\\:/:} userhost=${cur%%?(\\):*} @@ -2615,6 +2636,7 @@ fi [[ "$cur" == */* ]] || _known_hosts -c -a + local IFS=$'\t\n' COMPREPLY=( ${COMPREPLY[@]} $( command ls -aF1d $cur* \ 2>/dev/null | sed \ -e "s/[][(){}<>\",:;^&!$&=?\`|\\ ']/\\\\&/g" \