From 1bdf31c894835ecd28ba196a7f2d6e1b467010cf Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Sun, 23 Oct 2011 03:48:40 +0400 Subject: Don't use full path in the _completion_loader() function. --- bash_completion | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bash_completion b/bash_completion index 8b6cdb4f..eb5fffcf 100644 --- a/bash_completion +++ b/bash_completion @@ -1832,17 +1832,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 # Need to define *something*, otherwise there will be no completion at all. -- cgit v1.2.1