[Bash-completion-devel] [PATCH 1/2] Don't use full path in the _completion_loader() function.

Igor Murzov intergalactic.anonymous at gmail.com
Sat Oct 22 23:48:40 UTC 2011


---
 bash_completion |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/bash_completion b/bash_completion
index 4bfa4de..84bbe80 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1817,17 +1817,12 @@ _completion_loader()
     local compdir=./completions
     [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
 
-    # If full path below completions dir exists, use it.
-    if [[ $1 == */* && -f "$compdir/$1" ]]; then
-        . "$compdir/$1" &>/dev/null && return 124 || return 1
-    fi
-
     # Special case for init.d scripts.
     if [[ $1 == /etc?(/rc.d)/init.d/* ]]; then
         . "$compdir/service" &>/dev/null && return 124 || return 1
     fi
 
-    # Finally, try basename.
+    # Try basename.
     . "$compdir/${1##*/}" &>/dev/null && return 124
 
     # Fall back to something generic if we don't have anything else.
-- 
1.7.4.4




More information about the Bash-completion-devel mailing list