bash-completion: fix file completion with spaces

* Attempting to complete a file name with a space in it with more than one
   possible completion was failing
 * This was fixed upstream after the 2.1 release, but not part of any official
   release yet
 * Redhat bug: https://bugzilla.redhat.com/show_bug.cgi?id=1171396
 * Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740971

Closes Homebrew/homebrew#46918.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Steven Willis 2015-12-11 13:51:15 -05:00 committed by Dominyk Tiller
parent 0d85f56925
commit 0a8f00d2b8

View file

@ -54,6 +54,15 @@ diff --git a/bash_completion b/bash_completion
index 6601937..5184767 100644
--- a/bash_completion
+++ b/bash_completion
@@ -640,7 +640,7 @@
_quote_readline_by_ref "$cur" quoted
toks=( ${toks[@]-} $(
- compgen -d -- "$quoted" | {
+ compgen -d -- "$cur" | {
while read -r tmp; do
# TODO: I have removed a "[ -n $tmp ] &&" before 'printf ..',
# and everything works again. If this bug suddenly
@@ -1334,7 +1334,7 @@ _known_hosts_real()
# append any available aliases from config files