[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-241-g0a40e98

Ville Skyttä ville.skytta at iki.fi
Mon May 2 12:23:12 UTC 2011


The following commit has been merged in the master branch:
commit 457dbf6061eea5f2d1e3bccacf1691265f7321cc
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon May 2 13:51:55 2011 +0300

    _init_completion: Indicate that completion should not continue if cword == 0.
    
    http://thread.gmane.org/gmane.comp.shells.bash.bugs/16499
    http://lists.alioth.debian.org/pipermail/bash-completion-devel/2011-May/003635.html
    
    Thanks-to: Igor Murzov <igor at gplsoft.org>

diff --git a/bash_completion b/bash_completion
index 77e76b3..e88e2fc 100644
--- a/bash_completion
+++ b/bash_completion
@@ -740,7 +740,9 @@ _init_completion()
             i=$(( ++i ))
         fi
     done
-    [[ $cword -ge 1 ]] && prev=${words[cword-1]} || prev=
+
+    [[ $cword -eq 0 ]] && return 1
+    prev=${words[cword-1]}
 
     [[ $split ]] && _split_longopt && split=true
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list