tag 543982 +patch
thanks

Here's a patch which appears to fix the issue for me, running Bash 4.0-5ubuntu2.
I haven't tested it with older versions of Bash though. Please use it as you
wish, and make further changes if necessary.

-- 
Kind regards,
Chow Loong Jin
From cdd09c0420437f4cfec3ed4d62cf2fcc4cdda3f0 Mon Sep 17 00:00:00 2001
From: Chow Loong Jin <hyper...@gmail.com>
Date: Sun, 4 Oct 2009 17:05:35 +0800
Subject: [PATCH] Remove all quote_readline usages

Tab competion with spaces is broken when using quote_readline in
_filedir and _filedir_xspec. This patch removes all instances of its
usage.
---
 bash_completion |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bash_completion b/bash_completion
index 3cacea7..2e8f71c 100644
--- a/bash_completion
+++ b/bash_completion
@@ -395,7 +395,7 @@ _filedir()
 	#       bash-3.1.  See also:
 	#       http://www.mail-archive.com/bug-b...@gnu.org/msg01667.html
 	toks=( ${to...@]-} $(
-		compgen -d -- "$(quote_readline "$cur")" | {
+		compgen -d -- "$cur" | {
 			while read -r tmp; do
 				echo $tmp
 			done
@@ -405,7 +405,7 @@ _filedir()
 	if [[ "$1" != -d ]]; then
 		xspec=${1:+"!*.$1"}
 		toks=( ${to...@]-} $(
-			compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
+			compgen -f -X "$xspec" -- "$cur" | {
 				while read -r tmp; do
 					[ -n $tmp ] && echo $tmp
 				done
@@ -1587,7 +1587,7 @@ _filedir_xspec()
 	local tmp
 
 	toks=( ${to...@]-} $(
-		compgen -d -- "$(quote_readline "$cur")" | {
+		compgen -d -- "$cur" | {
 			while read -r tmp; do
 				# see long TODO comment in _filedir() --David
 				echo $tmp
@@ -1596,7 +1596,7 @@ _filedir_xspec()
 	))
 
 	toks=( ${to...@]-} $(
-		eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | {
+		eval compgen -f -X "$xspec" -- "\$cur" | {
 			while read -r tmp; do
 				[ -n $tmp ] && echo $tmp
 			done
-- 
1.6.3.3

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to