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

David Paleino dapal at debian.org
Mon Mar 8 11:42:22 UTC 2010


The following commit has been merged in the master branch:
commit 00560a88b4b4fdd99c8427da60c2b6039a30c8ad
Author: David Paleino <dapal at debian.org>
Date:   Tue Feb 9 10:59:47 2010 +0100

    _filedir: bash > 4 has the same behaviour regardless of $cur beginning with ' or not
    
      This can be triggered when $cur is actually empty, like, for example, when _filedir
      is manually launched from the command line:
    
        $ _filedir in
        $ echo ${COMPREPLY[@]}
        test doc .git contrib
    
      i.e. it's only showing the directories, not showing the files we're looking for.
      After this commit:
    
        $ . bash_completion
        $ _filedir in
        $ echo ${COMPREPLY[@]}
        test doc .git contrib bash_completion.sh.in Makefile.in
        $
    
      Which is the expected behaviour.

diff --git a/bash_completion b/bash_completion
index 84f9bd0..98f5214 100644
--- a/bash_completion
+++ b/bash_completion
@@ -588,7 +588,7 @@ _filedir()
     #
     if [[ "$1" != -d ]]; then
         xspec=${1:+"!*.$1"}
-        if [[ ${cur:0:1} == "'" && ${BASH_VERSINFO[0]} -ge 4 ]]; then
+        if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
             toks=( ${toks[@]-} $(
                 eval compgen -f -X \"\$xspec\" -- $quoted
             ) )

-- 
bash-completion



More information about the Bash-completion-commits mailing list