- _cd(): don't foist the new relative to absolute path conversion on people
who don't use $CDPATH
This commit is contained in:
parent
a830c5df6d
commit
ab3645b2c0
@ -1,6 +1,6 @@
|
||||
# bash_completion - some programmable completion functions for bash 2.05a
|
||||
#
|
||||
# $Id: bash_completion,v 1.230 2002/03/28 19:36:19 ianmacd Exp $
|
||||
# $Id: bash_completion,v 1.231 2002/03/28 23:41:44 ianmacd Exp $
|
||||
#
|
||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||
#
|
||||
@ -1703,13 +1703,17 @@ _cd()
|
||||
fi
|
||||
IFS=$' \t\n'
|
||||
_filedir -d
|
||||
if [ -n "$CDPATH" ]; then
|
||||
for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
|
||||
# remove leading ./ from completions
|
||||
COMPREPLY[i]=${COMPREPLY[i]#.\/}
|
||||
# turn relative paths from current dir into absolute ones
|
||||
[[ ${COMPREPLY[i]} != */* ]] && [ -d ${COMPREPLY[i]} ] && \
|
||||
# turn relative paths from current dir into
|
||||
# absolute ones
|
||||
[[ ${COMPREPLY[i]} != */* ]] && \
|
||||
[ -d ${COMPREPLY[i]} ] && \
|
||||
COMPREPLY[i]=$PWD/${COMPREPLY[i]}
|
||||
done
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user