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

Freddy Vulto fvulto at gmail.com
Sun Oct 4 16:23:41 UTC 2009


The following commit has been merged in the master branch:
commit 5177db1a589983236558c37d7b411afe2c37c226
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Sun Oct 4 18:08:33 2009 +0200

    Revert commit d3187b6f3
    Reverting yesterdays commit d3187b6f3 (Bugfix completing scp/sftp/ssh -F '' on bash-4), which said:
    
        set -- "${COMP_LINE:0:$COMP_POINT}"
    
    The problem with the line above is that it needs to be unquoted for `set' in order to break up COMP_LINE into separate arguments:
    
        set -- ${COMP_LINE:0:$COMP_POINT}
    
    But this will yield error "unexpected EOF while looking for matching `''" if COMP_LINE is containing unbalanced single/double quotes, e.g.:
    
        eval set -- scp -F 'config

diff --git a/contrib/ssh b/contrib/ssh
index 4cb331b..2070c23 100644
--- a/contrib/ssh
+++ b/contrib/ssh
@@ -83,7 +83,7 @@ _ssh()
 			-i -L -l -m -O -o -p -R -S -w' -- "$cur" ) )
 	else
 		# Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument
-		set -- "${COMP_LINE:0:$COMP_POINT}"
+		set -- "${COMP_WORDS[@]}"
 		while [ $# -gt 0 ]; do
 			if [ "${1:0:2}" = -F ]; then
 				if [ ${#1} -gt 2 ]; then
@@ -138,7 +138,7 @@ _sftp()
 			-- "$cur" ) )
 	else
 		# Search COMP_WORDS for '-F configfile' argument
-		set -- "${COMP_LINE:0:$COMP_POINT}"
+		set -- "${COMP_WORDS[@]}"
 		while [ $# -gt 0 ]; do
 			if [ "${1:0:2}" = -F ]; then
 				if [ ${#1} -gt 2 ]; then
@@ -196,7 +196,7 @@ _scp()
 		prefix=-F
 	else
 		# Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument
-		set -- "${COMP_LINE:0:$COMP_POINT}"
+		set -- "${COMP_WORDS[@]}"
 		while [ $# -gt 0 ]; do
 			if [ "${1:0:2}" = -F ]; then
 				if [ ${#1} -gt 2 ]; then

-- 
bash-completion



More information about the Bash-completion-commits mailing list