[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 8c24385c0252838c7744f02c0b6816b222e48762

Freddy Vulto fvulto at gmail.com
Sun Mar 1 16:05:17 UTC 2009


The following commit has been merged in the master branch:
commit 8c24385c0252838c7744f02c0b6816b222e48762
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Sun Mar 1 16:59:38 2009 +0100

    Moved commented quote outside subshell
    Moved comment-containing-quotes to outside subshell since commented
    quotes cause error messages in bash <= 3.1.  See also:
    http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html

diff --git a/bash_completion b/bash_completion
index eefc367..42cb0cc 100644
--- a/bash_completion
+++ b/bash_completion
@@ -274,15 +274,19 @@ _filedir()
 
 	local toks=( ) tmp
 	
+	# TODO: I've removed a "[ -n $tmp ] &&" before `echo $tmp',
+	#       and everything works again. If this bug
+	#       suddenly appears again (i.e. "cd /b<TAB>"
+	#       becomes "cd /"), remember to check for
+	#       other similar conditionals (here and
+	#       _filedir_xspec()). --David
+	# NOTE: The comment above has been moved outside of the subshell below, 
+	#       because quotes-in-comments-in-a-subshell cause errors on
+	#       bash-3.1.  See also: 
+	#       http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html
 	toks=( ${toks[@]-} $(
 		compgen -d -- "$(quote_readline "$cur")" | {
 			while read -r tmp; do
-				# TODO: I've removed a "[ -n $tmp ] &&" before,
-				#       and everything works again. If this bug
-				#       suddenly appears again (i.e. "cd /b<TAB>"
-				#       becomes "cd /"), remember to check for
-				#       other similar conditionals (here and
-				#       _filedir_xspec()). --David
 				echo $tmp
 			done
 		}

-- 
bash-completion



More information about the Bash-completion-commits mailing list