summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-03-09 16:18:52 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-03-09 16:18:52 +0000
commite71622dd0fc658fc3241b6bbf903fa3663ea0ebb (patch)
tree1b998079dfc64000d9c4a8ff3c480f23b6fd34ce /programs
parentdb5ccef46908f2f250afcc1f1002f05b365d7ad5 (diff)
downloadgvfs-e71622dd0fc658fc3241b6bbf903fa3663ea0ebb.tar.gz
Bug 523732 – gvfs-bash-completion.sh should not modify COMP_WORDBREAKS
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 svn path=/trunk/; revision=2307
Diffstat (limited to 'programs')
-rwxr-xr-xprograms/gvfs-bash-completion.sh16
1 files changed, 14 insertions, 2 deletions
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
}
####################################################################################################