diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | programs/gvfs-bash-completion.sh | 16 |
2 files changed, 21 insertions, 2 deletions
@@ -1,5 +1,12 @@ 2009-03-09 Alexander Larsson <alexl@redhat.com> + Bug 523732 – gvfs-bash-completion.sh should not modify COMP_WORDBREAKS + + * programs/gvfs-bash-completion.sh: + Don't override COMP_WORDBREAKS, instead workaround the colon problem + +2009-03-09 Alexander Larsson <alexl@redhat.com> + Bug 551683 – archive backend says file doesn't exist for directories * daemon/gvfsbackendarchive.c: diff --git a/programs/gvfs-bash-completion.sh b/programs/gvfs-bash-completion.sh index 5ec524d4..f5a3b9c9 100755 --- a/programs/gvfs-bash-completion.sh +++ b/programs/gvfs-bash-completion.sh @@ -24,14 +24,26 @@ #################################################################################################### -# don't misbehave on colons; See item E13 at http://tiswww.case.edu/php/chet/bash/FAQ -COMP_WORDBREAKS=${COMP_WORDBREAKS//:} __gvfs_multiple_uris() { local IFS=$'\n' local cur="${COMP_WORDS[COMP_CWORD]}" COMPREPLY=($(compgen -W '$(gvfs-ls --show-completions "$cur")' -- "")) + + # don't misbehave on colons; See item E13 at http://tiswww.case.edu/php/chet/bash/FAQ + # We handle this locally be extracting any BLAH: prefix and removing it from the result. + # Not great, but better than globally changing COMP_WORDBREAKS + + case "$cur" in + *:*) + case "$COMP_WORDBREAKS" in + *:*) colon_prefix=$(echo $cur | sed 's/:[^:]*$/:/' ) + COMPREPLY=${COMPREPLY##${colon_prefix}} + ;; + esac + ;; + esac } #################################################################################################### |